diff --git a/myhttp/httpc/httpclient.go b/myhttp/httpc/httpclient.go index 0b5c1ea..8771373 100644 --- a/myhttp/httpc/httpclient.go +++ b/myhttp/httpc/httpclient.go @@ -216,7 +216,10 @@ func (r *Request) Do(method, rawUrl string) (*Response, error) { req.URL.RawQuery = query.Encode() - req.Header.Set("Content-Type", r.contentType) + if r.contentType != "" { + req.Header.Set("Content-Type", r.contentType) + } + for k := range r.header { req.Header.Set(k, r.header.Get(k)) }