]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: sync Get and Head's documentation
authorMatthew Dempsky <mdempsky@google.com>
Tue, 23 Jun 2015 18:36:57 +0000 (11:36 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 25 Jun 2015 05:07:40 +0000 (05:07 +0000)
Instead of ambiguously referring to "the Client's CheckRedirect
function" in Head, describe the default behavior like for Get as users
aren't expected to change DefaultClient.CheckRedirect.

While here, use consistent punctuation for the Get and Head Client
method documentation.

Change-Id: I9e7046c73b0d0bc4de002234924d9e7c59aceb41
Reviewed-on: https://go-review.googlesource.com/11362
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/client.go

index 1c5e1911e01da5e86c149a07bb233a1661f40220..d5e3899fd3062b50cf8a4b789405443c4a574e86 100644 (file)
@@ -283,7 +283,7 @@ func Get(url string) (resp *Response, err error) {
 
 // Get issues a GET to the specified URL. If the response is one of the
 // following redirect codes, Get follows the redirect after calling the
-// Client's CheckRedirect function.
+// Client's CheckRedirect function:
 //
 //    301 (Moved Permanently)
 //    302 (Found)
@@ -497,9 +497,9 @@ func (c *Client) PostForm(url string, data url.Values) (resp *Response, err erro
        return c.Post(url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
 }
 
-// Head issues a HEAD to the specified URL.  If the response is one of the
-// following redirect codes, Head follows the redirect after calling the
-// Client's CheckRedirect function.
+// Head issues a HEAD to the specified URL.  If the response is one of
+// the following redirect codes, Head follows the redirect, up to a
+// maximum of 10 redirects:
 //
 //    301 (Moved Permanently)
 //    302 (Found)
@@ -513,7 +513,7 @@ func Head(url string) (resp *Response, err error) {
 
 // Head issues a HEAD to the specified URL.  If the response is one of the
 // following redirect codes, Head follows the redirect after calling the
-// Client's CheckRedirect function.
+// Client's CheckRedirect function:
 //
 //    301 (Moved Permanently)
 //    302 (Found)