httputil: Fix incorrect Content-Type header
This commit is contained in:
parent
30c63e66d1
commit
05948ac1ec
|
@ -140,8 +140,6 @@ func (c *Client) FastRequest(method, url string, opts ...RequestOption) error {
|
|||
|
||||
// RequestJSON performs a request and unmarshals the JSON body into "to".
|
||||
func (c *Client) RequestJSON(to interface{}, method, url string, opts ...RequestOption) error {
|
||||
opts = PrependOptions(opts, JSONRequest)
|
||||
|
||||
r, err := c.Request(method, url, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -72,7 +72,7 @@ func (r *DefaultRequest) AddQuery(values url.Values) {
|
|||
|
||||
func (r *DefaultRequest) AddHeader(header http.Header) {
|
||||
for key, values := range header {
|
||||
r.Header[key] = append(r.Header[key], values...)
|
||||
r.Header[key] = values
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue