Add oauth:get/3 and oauth:post/3 functions
Project: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/commit/2b001da2 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/tree/2b001da2 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/diff/2b001da2 Branch: refs/heads/import Commit: 2b001da23e1b33ee18bd14ff0c4501ccb3814935 Parents: fc5f528 Author: Tim Fletcher <[email protected]> Authored: Thu Jun 23 16:04:00 2011 +0100 Committer: Tim Fletcher <[email protected]> Committed: Thu Jun 23 16:04:00 2011 +0100 ---------------------------------------------------------------------- src/oauth.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-oauth/blob/2b001da2/src/oauth.erl ---------------------------------------------------------------------- diff --git a/src/oauth.erl b/src/oauth.erl index fe66d4a..c46728f 100644 --- a/src/oauth.erl +++ b/src/oauth.erl @@ -1,7 +1,7 @@ -module(oauth). --export([get/5, get/6, post/5, post/6, uri/2, header/1, sign/6, - params_decode/1, token/1, token_secret/1, verify/6]). +-export([get/3, get/5, get/6, post/3, post/5, post/6, uri/2, header/1, + sign/6, params_decode/1, token/1, token_secret/1, verify/6]). -export([plaintext_signature/2, hmac_sha1_signature/5, hmac_sha1_signature/3, rsa_sha1_signature/4, rsa_sha1_signature/2, @@ -15,6 +15,9 @@ -include_lib("public_key/include/public_key.hrl"). +get(URL, ExtraParams, Consumer) -> + get(URL, ExtraParams, Consumer, "", ""). + get(URL, ExtraParams, Consumer, Token, TokenSecret) -> get(URL, ExtraParams, Consumer, Token, TokenSecret, []). @@ -22,6 +25,9 @@ get(URL, ExtraParams, Consumer, Token, TokenSecret, HttpcOptions) -> SignedParams = sign("GET", URL, ExtraParams, Consumer, Token, TokenSecret), http_get(uri(URL, SignedParams), HttpcOptions). +post(URL, ExtraParams, Consumer) -> + post(URL, ExtraParams, Consumer, "", ""). + post(URL, ExtraParams, Consumer, Token, TokenSecret) -> post(URL, ExtraParams, Consumer, Token, TokenSecret, []).
