Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: How to submit name & password using LWP ?

by merlyn (Sage)
on Mar 04, 2001 at 00:48 UTC ( #62043=note: print w/replies, xml ) Need Help??

in reply to How to submit name & password using LWP ?

You're working too hard. From perldoc HTTP::Request::Common:
POST $url, [$form_ref], [Header => Value,...] This works mostly like GET() with POST as the method, but this function also takes a second optional array or hash reference parameter ($form_ref). This argu- ment can be used to pass key/value pairs for the form content. By default we will initialize a request using the "application/x-www-form-urlencoded" content type. This means that you can emulate a HTML <form> POSTing like this: POST '', [ name => 'Gisle Aas', email => '', gender => 'M', born => '1964', perc => '3%', ]; This will create a HTTP::Request object that looks like this: POST Content-Length: 66 Content-Type: application/x-www-form-urlencoded name=Gisle%20Aas& +perc=3%25

-- Randal L. Schwartz, Perl hacker

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://62043]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-10-22 19:13 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (229 votes). Check out past polls.