tf has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am trying to send GET requests to REST application
that demands custom headers authentication.
I tried setting headers with both REST::Client and WWW::Mechanize
but keep getting 401 error code response
Same url/method/headers do work using wget and curl
Any ideas?
Thanks!
use REST::Client; my $url = "http://foo/bar"; my $client = REST::Client->new(); $client->addHeader('u', 'ADMIN'); $client->addHeader('p', 'ADMIN'); $client->GET($url); print $client->responseContent();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: REST::Client GET with custom http headers authentication
by McA (Priest) on Mar 21, 2013 at 18:32 UTC | |
by Anonymous Monk on Feb 14, 2014 at 21:43 UTC | |
by Anonymous Monk on Feb 15, 2014 at 00:45 UTC | |
by Anonymous Monk on Feb 15, 2014 at 01:34 UTC | |
by Anonymous Monk on Feb 15, 2014 at 06:28 UTC | |
| |
by Anonymous Monk on Feb 15, 2014 at 01:48 UTC |