Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Getting error while decoding JSON object via POST method

by perlCrazy (Monk)
on Feb 06, 2013 at 08:40 UTC ( #1017357=note: print w/ replies, xml ) Need Help??


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:

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);
getting same error.


Comment on Re^4: Getting error while decoding JSON object via POST method
Download Code
Re^5: Getting error while decoding JSON object via POST method
by Corion (Pope) on Feb 06, 2013 at 09:01 UTC

    Where did you try what?

    I think that you are either not sending the data you think you're sending, or you're not receiving the data you think you're receiving. You have not shown working, self-contained code that exhibits the problem, so it's hard to replicate your problem or to understand what you're doing wrong.

    If you want to investigate this further, I suggest printing the values you get in the request to a log file on the receiving end.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017357]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-07-05 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls