http://www.perlmonks.org?node_id=1115227


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; }