Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Seek help posting to www-form-urlencoded . . .

by ikegami (Patriarch)
on Sep 17, 2009 at 15:29 UTC ( [id://795910]=note: print w/replies, xml ) Need Help??


in reply to Seek help posting to www-form-urlencoded . . .

It looks like the syntax of the HTTP::Request::Common's POST function, except you replaced the call to POST with the string POST. And then you commented out that line entirely! The following is closer to what you want
use HTTP::Request::Common qw( POST ); my $request = POST($url, action => 'Count', name => 'datafile', Content_Type => 'multipart/form-data', Content => [ 'file' => [ $ballot_file ]] );

But you're not quite there yet. You have content fields outside of Content. Fixed:

use HTTP::Request::Common qw( POST ); my $request = POST($url, Content_Type => 'multipart/form-data', Content => [ file => [ $ballot_file ], action => 'Count', name => 'datafile', ], );

The example in the docs is

POST 'http://www.perl.org/survey.cgi', Content_Type => 'form-data', Content => [ name => 'Gisle Aas', email => 'gisle@aas.no', gender => 'M', born => '1964', init => ["$ENV{HOME}/.profile"], ]

I don't know how you got from that to what you posted. Or maybe you didn't bother to read the docs...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found