http://www.perlmonks.org?node_id=1010814

gideondsouza has asked for the wisdom of the Perl Monks concerning the following question:

So I'm doing a POST request to github as part of an OAuth web flow authentication. (This is part of a sub in a Dancer app).

I use LWP::UserAgent::post() and the docs I linked to seem to say that method will return a HTTP::Response object. But I get a weird type.

When I send a post to github for the access_token is where I have a slight problemo:

my $code = params->{'code'}; my $browser = LWP::UserAgent->new; my $resp = $browser.post('https://github.com/login/oauth/access_token' +, [ client_id =>'<my client id>' client_secret => '<my secret>', code => $code,#the code I got in the param state => '<some state>' ]); #HERE>>>>>>>>>>>>>>>>>>>> # I cannot seem to figure what $resp is!?? #----- $resp->is_success doesn't work! return Dumper($resp);

    Issues
  1. If I use $resp->is_success then I get Can't locate object method "is_success"
  2. With the Data::Dumper I get the following response: $VAR1 = 'LWP::UserAgent=HASH(0x7fd8da50a690)Dancer::Route=HASH(0x7fd8da4dd6a8)';
Any ideas?? How should I go an inspect the object that is returned.? Am I getting two objects here?