Skip to content

Instantly share code, notes, and snippets.

@betawaffle
Created April 14, 2012 23:55
Show Gist options
  • Save betawaffle/2388782 to your computer and use it in GitHub Desktop.
Save betawaffle/2388782 to your computer and use it in GitHub Desktop.
sign(Req, Auth) ->
Params = Req#req.params,
Method = Req#req.method,
Url = Req#req.url,
{H, P} = oauth_params(Params, Auth),
Sig = signature(Method, Url, P, Auth),
IoList = ["OAuth ",
"oauth_signature", $=, Sig
|H],
Req#req{headers = [{"Authorization", iolist_to_string(IoList)}
| Req#req.headers]}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment