Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 meditating upon the Monastery: (13)
As of 2014-09-17 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (82 votes), past polls