#!perl use strict; use warnings; use Mojo::UserAgent; my $ua = Mojo::UserAgent->new( 'insecure' => '1' ); my $tx = $ua->build_tx( 'POST' => 'https://my.webpage.com/my/path', { 'Accept' => '*/*', 'User-Agent' => 'curl/7.55.1', 'Content-Length' => '15', 'Content-Type' => 'application/x-www-form-urlencoded', 'My-Header' => 'alfa', 'My-Header-2' => 'beta' }, "here is my data" ); my $res = $ua->start($tx)->result; __END__ Created from curl command line curl -kv -X POST "https://my.webpage.com/my/path" --header 'My-Header: alfa' --header 'My-Header-2: beta' --data-raw 'here is my data'