Hi all,=0A=0AI want to Pass the credentials and the Post parameters in a
re=
quest and need to get the response content.=0A=0AI tried with the
following=
approach. =0A=0A1) Credentials are getting passed correctly however am
not=
getting the parameter passed. =0A=0A2) If am passing the credentials in
th=
e url it is working fine. I want to pass the credential in header=0A=0A3)
G=
etting 401 - AUTH_REQUIRED Message=0A=0AMethod I:=0A=0Ause
LWP::UserAgent;=
=0Ause HTTP::Request;=0Ause HTTP::Request::Common;=0Ause
Data::Dumper;=0Amy=
$ua =3D new LWP::UserAgent;=0A$username =3D 'username';=0A$password =3D
'p=
assword';=0A$uri =3D 'https://url/goeshere';=0A$in
=3D {'test1' =3D>
'test'=
};=0Amy $ua =3D LWP::UserAgent->new;=0Amy $req =3D HTTP::Request->new(POST
=
=3D> $uri,Content =3D> $in);=0A$req->authorization_basic($username,
$passwo=
rd);=0A$req->header("Content-Type" =3D>
"application/x-www-form-urlencoded"=
);=0Amy $output=3D$ua->request($req)->content;=0Aprint Dumper $output;=0A=
=0AMethod II:=0A=0Ause LWP::UserAgent;=0Ause HTTP::Request;=0Ause
HTTP::Req=
uest::Common;=0Ause Data::Dumper;=0Amy $ua =3D new LWP::UserAgent;=0A$in =
=3D {'test1' =3D> 'test'};=0Amy $res =3D
$ua->post('https://username:passwo=
rd@[EMAIL PROTECTED]
', $in);=0Aprint Dumper $res->content;=0A=0AMethod III:=0A=
=0Ause LWP::UserAgent;=0Ause HTTP::Request;=0Ause
HTTP::Request::Common;=0A=
use Data::Dumper;=0Amy $ua =3D new LWP::UserAgent;=0A$url =3D
"https://url/=
goeshere";=0A$in =3D {'test1' =3D> 'test'};=0A$ua->credentials($url,
'TESTR=
EALM', 'username' =3D> 'password');=0Amy $res =3D $ua->post($url,
$in);=0Ap=
rint Dumper $res->content;=0A=0A=0APlease guide me, =0A=0AI want to Pass
bo=
th credentials and parameters through headers.=0A=0AThanks,=0APrabu=0A=0A=
=0A=0A Unlimited freedom, unlimited storage. Get it now, on
http://hel=
p.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/


|