Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: File POSTing with WWW::Curl::Easy

by Anonymous Monk
on Jan 26, 2012 at 15:07 UTC ( #950111=note: print w/ replies, xml ) Need Help??


in reply to File POSTing with WWW::Curl::Easy

perl CURL upload -> curl upload xml file

CURL upload site:perlmonks.org -> Correct way to POST with Perl Curl?

curl attachment site:search.cpan.org -> WWW::Curl::Form

use WWW::Curl::Form; my $curlf = WWW::Curl::Form->new; $curlf->formaddfile($filename, 'attachment', "multipart/form-data" +); $curlf->formadd("FIELDNAME", "VALUE"); $curl->setopt(CURLOPT_HTTPPOST, $curlf);

Yup, I think I'd stick with WWW::Curl::Form


Comment on Re: File POSTing with WWW::Curl::Easy
Download Code
Re^2: File POSTing with WWW::Curl::Easy
by kurt2439 (Sexton) on Jan 27, 2012 at 15:10 UTC

    You're right -- the WWW::Curl::Form made this super easy after I realized that the package created the linked list object to include as an argument to the CURLOPT_HTTPPOST in your curl handle and was NOT a separate, limited curl handle object (I know, I know, it was right there in the code example but it was so easy to overlook). It does require a newer version of WWW::Curl than ship with CentOS5 just for reference for others. Learned a bunch about the different POST options sludging through the curl.haxx.se pages too

    Thanks for the links and the help. Guess I should have done a better job searching here. I shall do penance

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-04 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls