Merge pull request #11 from 178inaba/http_method_const

Fix http method from string to const when calling instance API
pull/13/head
mattn 2017-04-15 12:19:01 +09:00 committed by GitHub
commit 41d1228d88
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package mastodon
import "net/http"
// Instance hold information for mastodon instance.
type Instance struct {
URI string `json:"uri"`
@ -11,7 +13,7 @@ type Instance struct {
// GetInstance return Instance.
func (c *Client) GetInstance() (*Instance, error) {
var instance Instance
err := c.doAPI("GET", "/api/v1/instance", nil, &instance)
err := c.doAPI(http.MethodGet, "/api/v1/instance", nil, &instance)
if err != nil {
return nil, err
}