7 // NoBody is an io.ReadCloser with no bytes. Read always returns EOF
8 // and Close always returns nil. It can be used in an outgoing client
9 // request to explicitly signal that a request has zero bytes.
10 // An alternative, however, is to simply set Request.Body to nil.
12 // Copy of Go 1.8 NoBody type from net/http/http.go
15 func (noBody) Read([]byte) (int, error) { return 0, io.EOF }
16 func (noBody) Close() error { return nil }
17 func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil }
19 // Is an empty reader that will trigger the Go HTTP client to not include
20 // and body in the HTTP request.
21 var noBodyReader = noBody{}