GetBody returns a new reader of the encoded bytes, enabling request retries. This is required for HTTP/2 connections to handle server GOAWAY during graceful shutdown.
()
| 216 | // GetBody returns a new reader of the encoded bytes, enabling request retries. |
| 217 | // This is required for HTTP/2 connections to handle server GOAWAY during graceful shutdown. |
| 218 | func (je *jsonEncoder) GetBody() (io.ReadCloser, error) { |
| 219 | if len(je.b) == 0 { |
| 220 | return nil, errEncodeNotCalled |
| 221 | } |
| 222 | return io.NopCloser(bytes.NewReader(je.b)), nil |
| 223 | } |
| 224 | |
| 225 | // ResponseDecoder returns a HTTP response decoder. |
| 226 | // The decoder handles the following content types: |
no outgoing calls