From 40c0a4759dce7173fcf24c445729e52ae82a4799 Mon Sep 17 00:00:00 2001 From: Petar Maymounkov Date: Mon, 22 Feb 2010 14:46:59 -0800 Subject: http: fix bug in Post R=rsc CC=golang-dev http://codereview.appspot.com/217059 Committer: Russ Cox --- src/pkg/http/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pkg') diff --git a/src/pkg/http/client.go b/src/pkg/http/client.go index 8af6c761f..8c2c30124 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 { -- cgit v1.2.3