#!perl use strict; use warnings; use HTTP::Tiny; my $ua = HTTP::Tiny->new(); my $res = $ua->request( 'POST' => 'https://my.webpage.com/my/path', { headers => { 'Content-Length' => '15', 'User-Agent' => 'curl/7.55.1', 'My-Header-2' => 'beta', 'My-Header' => 'alfa', 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => '*/*' }, content => "here is my data" }, ); __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' #### #!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'