1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-11-22 04:23:39 +00:00

httputil: Fix incorrect Content-Type header

This commit is contained in:
diamondburned 2022-04-02 22:34:41 -07:00
parent 30c63e66d1
commit 05948ac1ec
No known key found for this signature in database
GPG key ID: D78C4471CE776659
2 changed files with 1 additions and 3 deletions

View file

@ -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

View file

@ -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
} }
} }