Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Passing both GET and POST params to HTTP Request

by Doctrin (Beadle)
on Feb 23, 2013 at 11:27 UTC ( [id://1020296]=perlquestion: print w/replies, xml ) Need Help??

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

Hello dear Monks :) Say, I want to POST to an url like http://mysite.org/some/url/?with=params&some=else with a basic authorization. So, I do:
my $HttpReq = HTTP::Request->new( POST => "http://mysite.org/some/url/ +?with=params&some=else"); $HttpReq->authorization_basic(&MY_LOGIN, &MY_PASSWORD);
It works; BUT, is there a way to provide GET params more, say, gently, like that, maybe:
my $HttpReq = HTTP::Request->new( POST => "http://mysite.org/some/url" +, getparams => [with => 'params',some => 'else']); $HttpReq->authorization_basic(&MY_LOGIN, &MY_PASSWORD);
Thanks in advance

Replies are listed 'Best First'.
Re: Passing both GET and POST params to HTTP Request
by moritz (Cardinal) on Feb 23, 2013 at 12:19 UTC
      Thanks! URI would do the trick, I think :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1020296]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-19 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found