]> Cypherpunks repositories - gostls13.git/commitdiff
http: fix bug in Post
authorPetar Maymounkov <petarm@gmail.com>
Mon, 22 Feb 2010 22:46:59 +0000 (14:46 -0800)
committerRuss Cox <rsc@golang.org>
Mon, 22 Feb 2010 22:46:59 +0000 (14:46 -0800)
R=rsc
CC=golang-dev
https://golang.org/cl/217059

src/pkg/http/client.go

index 8af6c761f668b8e481e4a7ea2333de3e9d8cd61e..8c2c30124fc28e0186890cc6c087092ca9eacd62 100644 (file)
@@ -137,11 +137,13 @@ func Get(url string) (r *Response, finalURL string, err os.Error) {
 func Post(url string, bodyType string, body io.Reader) (r *Response, err os.Error) {
        var req Request
        req.Method = "POST"
+       req.ProtoMajor = 1
+       req.ProtoMinor = 1
        req.Body = nopCloser{body}
        req.Header = map[string]string{
                "Content-Type": bodyType,
-               "Transfer-Encoding": "chunked",
        }
+       req.TransferEncoding = []string{"chunked"}
 
        req.URL, err = ParseURL(url)
        if err != nil {