Commit 2ede818a authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: document Request.Body more

Fixes #6221

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13289043
parent c7c1a1bb
...@@ -105,7 +105,16 @@ type Request struct { ...@@ -105,7 +105,16 @@ type Request struct {
// following a hyphen uppercase and the rest lowercase. // following a hyphen uppercase and the rest lowercase.
Header Header Header Header
// The message body. // Body is the request's body.
//
// For client requests, a nil body means the request has no
// body, such as a GET request. The HTTP Client's Transport
// is responsible for calling the Close method.
//
// For server requests, the Request Body is always non-nil
// but will return EOF immediately when no body is present.
// The Server will close the request body. The ServeHTTP
// Handler does not need to.
Body io.ReadCloser Body io.ReadCloser
// ContentLength records the length of the associated content. // ContentLength records the length of the associated content.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment