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

Commit

Permalink
Trello Client supports PUT requests
Browse files Browse the repository at this point in the history
  • Loading branch information
korya committed Aug 31, 2016
1 parent eca4260 commit 937d1d6
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 937d1d6

Please sign in to comment.