Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^14: json return value

by stenasc (Novice)
on Jul 27, 2013 at 11:50 UTC ( #1046648=note: print w/ replies, xml ) Need Help??


in reply to Re^13: json return value
in thread json return value

When I post the same json test to my test url using a perl client and print it back using Data::Dumper, I get the response

$VAR1 = '{"imei":13226004711772,"id":20}'; which is fine.

However, if I post it using our embedded C commands in our unit, I receive ...

$VAR1 = undefined.

...not much help there.

I have posted it to another website based on PHP and the data shows up there. I get the response

(POST: ) (BODY: {"par":12345678912345,"id":20 }) which I expect.

so I know it is being posted OK. It looks at the moment as it our unit is coding it in a format that this line..

my $data = $q->param('POSTDATA');

is having a problem with.


Comment on Re^14: json return value
Re^15: json return value
by Anonymous Monk on Jul 28, 2013 at 02:46 UTC

      Perl module was 3.15, upgraded to 3.63. Still no difference.

      $VAR1 = undef;

      returned after I do a post to the website. Also tried setting $CGI::PARAM_UTF8=0; but again no difference.

      The following php lines allow the data to be decoded correctly but again I'm no php expert.

      $post_body = file_get_contents('php://input'); $jdata = CJSON::decode($post_body);
        so Dumper the $query

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-12-28 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls