in reply to Re^3: curl http post using LWP::Curl
in thread curl http post using LWP::Curl
use LWP::Curl; use Net::Curl::Easy qw(:constants); my $lwpcurl = LWP::Curl->new(); my $referer = 'http://server.com/:5555'; my $post_url = 'http://userid:password@server.com:5555/receive'; open(my $fh, "<", "test.xml"); or die "can not open file ($!)"; $lwpcurl->{agent}->setopt( CURLOPT_READDATA, $fh ); $lwpcurl->{agent}->setopt( CURLOPT_HEADERDATA, ['Content-Type:text/xml +'] ); my $content = $lwpcurl->post($post_url, {}, $referer);
|
|---|