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,