Skip to content

Instantly share code, notes, and snippets.

@masaki
Last active Dec 14, 2015
Embed
What would you like to do?
use OAuth::Lite::Consumer;
use Furl 2.08;
my $oauth = OAuth::Lite::Consumer->new(
ua => Furl->new(keep_request => 1),
);
my %args = (
method => 'POST',
url => 'http://example.com/oauth',
headers => [ Accept => q{...}, 'Content-Type' => q{...} ],
content => $content,
realm => $realm,
($access_token ? (token => $access_token) : (token => $oauth->access_token)),
);
my ($req, $res) = do {
my $res = $oauth->request(%args);
($res->request, $res);
};
# $req: Furl::Request
# $res: Furl::Response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment