in reply to curl http post using LWP::Curl
If the -d @test.xml command is supposed to read the file test.xml into memory and send it as the body of the POST request, I guess you'll have to do the part of reading the file in Perl.
my $filename = 'test.xml'; open my $fh, '<', $filename or die "Couldn't read '$filename': $!"; binmode $fh, ':raw'; my $content = do { local $/; <$fh> }; # sluuurp $hash_form = { ... data => $content ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: curl http post using LWP::Curl
by wanderedinn (Sexton) on Jun 07, 2016 at 16:31 UTC | |
by Corion (Patriarch) on Jun 07, 2016 at 16:34 UTC | |
by wanderedinn (Sexton) on Jun 07, 2016 at 16:39 UTC |