Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^11: json return value

by Anonymous Monk
on Jul 16, 2013 at 14:13 UTC ( #1044615=note: print w/ replies, xml ) Need Help??


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

Server log is...

that is access log, not error log, you want error log like the checklists explain :) Server error, see CGI Help Guide , Troubleshooting Perl CGI scripts, CGI::Carp, DebugCGI , CGI::Carp::Fatals


Comment on Re^11: json return value
Re^12: json return value
by stenasc (Novice) on Jul 25, 2013 at 23:51 UTC

    This novice is back again. My cgi works when the following line of code is used as it uses the parameters after the logical or operator...

    my $data = $q->param('POSTDATA') || '{"a":100,"b":300}';

    but it doesn't when the following line is used...

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

    I'm posting up the following json statement which I checked on jsonlint and gave no errors.

    {"par":12345678912345,"id":20}

    I get the following webserver error message

    File does not exist: /home/myurl/public_html/500.shtml

    It looks to as if the parameters are not parsed correctly or are not being received properly. Any help greatly appreciated

        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-09-16 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (48 votes), past polls