]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: rename Post's parameter from bodyType to contentType
authorBrady Sullivan <brady@bsull.com>
Fri, 16 Sep 2016 22:25:07 +0000 (15:25 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 19 Sep 2016 16:08:31 +0000 (16:08 +0000)
Change-Id: Ie1b08215c02ce3ec72a4752f4b800f23345ff99d
Reviewed-on: https://go-review.googlesource.com/29362
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/client.go

index fb00f714ff2be1ef0e1aafe26ab136869233271c..39c38bd8dd0ff8ae92968bb37344a7a5b43f445e 100644 (file)
@@ -571,8 +571,8 @@ func defaultCheckRedirect(req *Request, via []*Request) error {
 // Post is a wrapper around DefaultClient.Post.
 //
 // To set custom headers, use NewRequest and DefaultClient.Do.
-func Post(url string, bodyType string, body io.Reader) (resp *Response, err error) {
-       return DefaultClient.Post(url, bodyType, body)
+func Post(url string, contentType string, body io.Reader) (resp *Response, err error) {
+       return DefaultClient.Post(url, contentType, body)
 }
 
 // Post issues a POST to the specified URL.
@@ -583,12 +583,12 @@ func Post(url string, bodyType string, body io.Reader) (resp *Response, err erro
 // request.
 //
 // To set custom headers, use NewRequest and Client.Do.
-func (c *Client) Post(url string, bodyType string, body io.Reader) (resp *Response, err error) {
+func (c *Client) Post(url string, contentType string, body io.Reader) (resp *Response, err error) {
        req, err := NewRequest("POST", url, body)
        if err != nil {
                return nil, err
        }
-       req.Header.Set("Content-Type", bodyType)
+       req.Header.Set("Content-Type", contentType)
        return c.doFollowingRedirects(req, shouldRedirectPost)
 }