From: Petar Maymounkov Date: Mon, 22 Feb 2010 22:46:59 +0000 (-0800) Subject: http: fix bug in Post X-Git-Tag: weekly.2010-02-23~14 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e465ad3cbda8ee8aec4ae188ad878e4ce1e079dc;p=gostls13.git http: fix bug in Post R=rsc CC=golang-dev https://golang.org/cl/217059 --- diff --git a/src/pkg/http/client.go b/src/pkg/http/client.go index 8af6c761f6..8c2c30124f 100644 --- a/src/pkg/http/client.go +++ b/src/pkg/http/client.go @@ -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 {