mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-11-22 12:33:38 +00:00
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".
|
// RequestJSON performs a request and unmarshals the JSON body into "to".
|
||||||
func (c *Client) RequestJSON(to interface{}, method, url string, opts ...RequestOption) error {
|
func (c *Client) RequestJSON(to interface{}, method, url string, opts ...RequestOption) error {
|
||||||
opts = PrependOptions(opts, JSONRequest)
|
|
||||||
|
|
||||||
r, err := c.Request(method, url, opts...)
|
r, err := c.Request(method, url, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ func (r *DefaultRequest) AddQuery(values url.Values) {
|
||||||
|
|
||||||
func (r *DefaultRequest) AddHeader(header http.Header) {
|
func (r *DefaultRequest) AddHeader(header http.Header) {
|
||||||
for key, values := range header {
|
for key, values := range header {
|
||||||
r.Header[key] = append(r.Header[key], values...)
|
r.Header[key] = values
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue