curl -d '{"some":"json"}' destination
gives
#!perl
use strict;
use warnings;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new( 'send_te' => '0' );
my $r = HTTP::Request->new(
'POST' => 'http://destination/',
[
'Accept' => '*/*',
'Host' => 'destination:80',
'User-Agent' => 'curl/7.55.1',
'Content-Length' => '15',
'Content-Type' => 'application/x-www-form-urlencoded',
],
"{\x22some\x22:\x22json\x22}"
);
my $res = $ua->request( $r, );
__END__
Created from curl command line
curl -d '{"some":"json"}' destination
This should give the OP a decent starting point. |