Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Reading Raw data in CGI::Application

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


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


Comment on Re: Reading Raw data in CGI::Application
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://593003]
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 2014-07-14 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (257 votes), past polls