From a25056d2ccc3b7252ce26252bec7c3b51bbeb95c Mon Sep 17 00:00:00 2001 From: 178inaba <178inaba@users.noreply.github.com> Date: Sun, 16 Apr 2017 00:47:23 +0900 Subject: [PATCH] Add Content-Type header to doAPI --- mastodon.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mastodon.go b/mastodon.go index 2919e66..06f460b 100644 --- a/mastodon.go +++ b/mastodon.go @@ -36,6 +36,9 @@ func (c *Client) doAPI(method string, uri string, params url.Values, res interfa return err } req.Header.Set("Authorization", "Bearer "+c.config.AccessToken) + if params != nil { + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + } resp, err = c.Do(req) if err != nil { return err