Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: XPOST syntax in WWW::Curl

by pme (Monsignor)
on Feb 01, 2015 at 15:57 UTC ( [id://1115227]=note: print w/replies, xml ) Need Help??

in reply to XPOST syntax in WWW::Curl

Hi Steve_BZ,

This is a LWP::UserAgent based solution. The code snippet is untested and definitely needs modification to insert into your code environmant.

use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST => "$url"); # -X $req->header('Authorization' => "Token $token"); # -H my $res = $ua->request($req, [ $gl_media_defaults{v_suffix} => "\@$fil +e_to_upload"]); # -F if ($res->is_success) { print $res->content; } else { print $res->message; }

Replies are listed 'Best First'.
Re^2: XPOST syntax in WWW::Curl
by Steve_BZ (Chaplain) on Feb 01, 2015 at 17:00 UTC

    Hi pme,

    Thanks for that.

    Well it seemed to work (that is to say it didn't error). I won't be able to see until tomorrow if the files were uploaded or not.

    The only thing that was suspicious is that the mp4 file was too quick to upload, so I imagine there was a problem.

    However, it gives me something to work on and debug. Thanks very much,



Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-06-16 09:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.