Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
Do you know where your variables are?
 
PerlMonks  

Re: Reading Raw data in CGI::Application

by derby (Abbot)
on Jan 04, 2007 at 14:16 UTC ( [id://593003]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Reading Raw data in CGI::Application

That's a feature of CGI - it's treating your post data as an ISINDEX script. Definitely not something you want to rely on:

#!/usr/local/bin/perl use strict; use warnings; use CGI; use Data::Dumper; my $cgi = CGI->new( '{ "Image": { "Width": 800, "Height": 600, "Title": "View from 15th Floor", "Thumbnail": { "Url": "http://www.example.com/image/481989943", "Height": 125, "Width": "100" }, "IDs": [116, 943, 234, 38793] } }' ); print Dumper( $cgi ); $cgi = CGI->new( '{ "Image": { "Width=": 800, "Height": 600, "Title": "View from 15th Floor", "Thumbnail": { "Url": "http://www.example.com/image/481989943", "Height": 125, "Width": "100" }, "IDs": [116, 943, 234, 38793] } }' ); print Dumper( $cgi );
The first dump will show you the JSON data associated with the keyword param. The second dump will show you the hilarity that will ensue if there's an equal signs somewhere in your data.

Your best bet is to provide a cgi_get_query method that deals with the data how you want to deal with it (as outlined in the docs for CGI::Application).

-derby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://593003]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.