1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:14:44 -07:00

http: fix bug in Post

R=rsc
CC=golang-dev
https://golang.org/cl/217059
This commit is contained in:
Petar Maymounkov 2010-02-22 14:46:59 -08:00 committed by Russ Cox
parent 7870672c7f
commit e465ad3cbd

View 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 {