Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 -> Correct way to POST with Perl Curl?

curl attachment -> 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
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 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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2015-10-09 13:26 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (242 votes), past polls