Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Anonymous Monk
on Jan 26, 2012 at 15:07 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950111]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found