Add Content-Type header to doAPI

pull/13/head
178inaba 2017-04-16 00:47:23 +09:00
parent 84038cfd79
commit a25056d2cc
1 changed files with 3 additions and 0 deletions

View File

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