Commit e465ad3c authored by Petar Maymounkov's avatar Petar Maymounkov Committed by Russ Cox

http: fix bug in Post

R=rsc
CC=golang-dev
https://golang.org/cl/217059
parent 7870672c
...@@ -137,11 +137,13 @@ func Get(url string) (r *Response, finalURL string, err os.Error) { ...@@ -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) { func Post(url string, bodyType string, body io.Reader) (r *Response, err os.Error) {
var req Request var req Request
req.Method = "POST" req.Method = "POST"
req.ProtoMajor = 1
req.ProtoMinor = 1
req.Body = nopCloser{body} req.Body = nopCloser{body}
req.Header = map[string]string{ req.Header = map[string]string{
"Content-Type": bodyType, "Content-Type": bodyType,
"Transfer-Encoding": "chunked",
} }
req.TransferEncoding = []string{"chunked"}
req.URL, err = ParseURL(url) req.URL, err = ParseURL(url)
if err != nil { if err != nil {
......
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