Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Add oauth:get/3 and oauth:post/3 functions
  • Loading branch information
tim committed Jun 23, 2011
1 parent fc5f528 commit 2b001da23e1b33ee18bd14ff0c4501ccb3814935
Showing 1 changed file with 8 additions and 2 deletions.
@@ -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,13 +15,19 @@

-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, []).

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, []).

0 comments on commit 2b001da

Please sign in to comment.