post request with authentication in perl
Note to myself to make a POST request in perl.
Reading the result is similar to php
use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(POST => 'http://somesite; $req->authorization_basic('user', 'pass'); $req->header('Content-Type' => 'application/xml'); $req->content(request values); $res = $ua->request($req);
Reading the result is similar to php
Comments
Post a Comment