-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable bare requests to be made from ExTrello:
- get, post, put, delete requests can be constructed using simple function calls to - signed parameter values removed from query params (this was bad, so now there's no worries there) - correctly use :headers option for HTTPotion - correctly use request body when using post, put, delete
- Loading branch information
Christopher Yammine
committed
Aug 12, 2016
1 parent
1c76b1a
commit 04b935b
Showing
6 changed files
with
117 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
defmodule ExTrello.API.BareRequests do | ||
@moduledoc """ | ||
This module exists to provide ExTrello users with an interface to easily make requests to Trello that have not yet | ||
been implemented in the wrapper. | ||
TODO: Add some 'best guess' parsing of responses to provide anyone who uses these functions the same structured responses | ||
as the other implemented functions. | ||
Still not 100% on this, may just leave bare responses exposed for people who don't find value in the named structs. | ||
""" | ||
|
||
import ExTrello.API.Base | ||
|
||
def get(path), do: get(path, []) | ||
def get(path, params) when is_list(params) do | ||
request(:get, path, params) | ||
end | ||
|
||
def post(path), do: post(path, []) | ||
def post(path, params) when is_list(params) do | ||
request(:post, path, params) | ||
end | ||
|
||
def put(path), do: put(path, []) | ||
def put(path, params) when is_list(params) do | ||
request(:put, path, params) | ||
end | ||
|
||
def delete(path), do: delete(path, []) | ||
def delete(path, params) when is_list(params) do | ||
request(:delete, path, params) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters