Re: Separating GET and POST parameters

Jonathan Swartz <[email protected]> Wed, 3 Aug 2005 07:32:33 -0700
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
Taking different actions depending on whether a parameter was passed  
by GET or POST seems like a bad idea from the standpoint of code  
readability and coherence...and it will make your application non- 
portable, since most application frameworks will just merge the  
arguments. I'd recommend not going down this path.

Jon

On Jul 11, 2005, at 1:41 PM, Jeremy Morton wrote:


> Hello.  I noticed from the HTML::Mason FAQ that Mason merges the  
> GET and
> POST params into the %ARGS hash.  This is kinda annoying, as  
> sometimes I'd
> like to distinguish between the two, and maybe only take action if  
> a param
> is passed a certain way.
>
> I understand that it probably does this because it uses the CGI module
> underneath, which annoyingly also merges the two.  However, maybe  
> it could
> start using CGI::Simple, which has the url_param() sub?  This sub  
> allows
> just the GET params to be accessed independently of the POST  
> params, so a
> %GETARGS and %POSTARGS hash could be added to the variables  
> available to
> HTML::Mason code.  Alternatively it could perhaps read $ENV 
> {'QUERY_STRING'},
> but unfortunately, if both POST and GET have been used to submit at  
> the same
> time, I believe the CGI module merges both of these data into one  
> hash,
> which is not what we want; CGI::Simple will only put the POST data  
> in its
> param() responses, by default, if the request method was POST.
>
> Comments welcome!
>
>
> -- 
> Best regards,
> Jeremy Morton (Jez)
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar  
> happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in  
> dual
> core and dual graphics technology at this free one hour event  
> hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Mason-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-devel
>
>
>




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click