in reply to Re: capturing stdout of pipe
in thread capturing stdout of pipe
Also, for converting Curl command lines to LWP (or HTTP::Tiny), see HTTP::Request::FromCurl, or its live site at https://corion.net/curl2lwp.psgi.
The Curl command
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.
|
|---|