Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #31 from PlanitarInc/master
Browse files Browse the repository at this point in the history
Trello Client supports PUT requests
  • Loading branch information
VojtechVitek authored Sep 20, 2016
2 parents 7194569 + 937d1d6 commit 4444b7b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ func (c *Client) Post(resource string, data url.Values) ([]byte, error) {
return c.do(req)
}

func (c *Client) Put(resource string, data url.Values) ([]byte, error) {
req, err := http.NewRequest("PUT", c.endpoint+resource, strings.NewReader(data.Encode()))
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

return c.do(req)
}

func (c *Client) Delete(resource string) ([]byte, error) {
req, err := http.NewRequest("DELETE", c.endpoint+resource, nil)
if err != nil {
Expand Down

0 comments on commit 4444b7b

Please sign in to comment.