]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document Request.Body more
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 27 Aug 2013 23:13:21 +0000 (16:13 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 27 Aug 2013 23:13:21 +0000 (16:13 -0700)
Fixes #6221

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13289043

src/pkg/net/http/request.go

index 603299df555455aea46c471f37190be52f785bf8..ccdf12111792ce8666b26f8c96a436fb171506c5 100644 (file)
@@ -105,7 +105,16 @@ type Request struct {
        // following a hyphen uppercase and the rest lowercase.
        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
 
        // ContentLength records the length of the associated content.