Commit 2bcdb5a5 authored by Matthew Dempsky's avatar Matthew Dempsky

net/http: sync Get and Head's documentation

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/11362Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent d6ef6eb6
...@@ -283,7 +283,7 @@ func Get(url string) (resp *Response, err error) { ...@@ -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 // 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 // following redirect codes, Get follows the redirect after calling the
// Client's CheckRedirect function. // Client's CheckRedirect function:
// //
// 301 (Moved Permanently) // 301 (Moved Permanently)
// 302 (Found) // 302 (Found)
...@@ -497,9 +497,9 @@ func (c *Client) PostForm(url string, data url.Values) (resp *Response, err erro ...@@ -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())) 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 // Head issues a HEAD to the specified URL. If the response is one of
// following redirect codes, Head follows the redirect after calling the // the following redirect codes, Head follows the redirect, up to a
// Client's CheckRedirect function. // maximum of 10 redirects:
// //
// 301 (Moved Permanently) // 301 (Moved Permanently)
// 302 (Found) // 302 (Found)
...@@ -513,7 +513,7 @@ func Head(url string) (resp *Response, err error) { ...@@ -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 // 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 // following redirect codes, Head follows the redirect after calling the
// Client's CheckRedirect function. // Client's CheckRedirect function:
// //
// 301 (Moved Permanently) // 301 (Moved Permanently)
// 302 (Found) // 302 (Found)
......
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