in reply to Re^3: Getting error while decoding JSON object via POST method
in thread Getting error while decoding JSON object via POST method
mo luck!! tried like this:
getting same error.my $inData = { "name" => "test", "id" => "test", "test" => [1,2,3,4],} +; my $json = JSON->new->utf8->allow_nonref; my $jsonData = $json->encode($inData); print Dumper($jsonData); ##Output of dumper : $VAR1 = '{"test":[1,2,3,4],"name":"test","id":"test"}'; # post set post request my $req = HTTP::Request->new('POST', $rest_url); $req->content($jsonData); my $response = $iua->request($req);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Getting error while decoding JSON object via POST method
by Corion (Patriarch) on Feb 06, 2013 at 09:01 UTC |
In Section
Seekers of Perl Wisdom