You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Igor Chudov <ic...@gmail.com> on 2011/05/15 17:02:40 UTC

How to tell GET from POST method ni CGI.pm?

I am beginning to work on hardening my website against cross site request
forgeries. I use CGI.pm.

My question is, how can I tell, using CGI.pm,  if this webpage was invoked
with a GET or POST method?

Thanks

Re: How to tell GET from POST method ni CGI.pm?

Posted by Randolf Richardson <ra...@modperl.pl>.
> I am beginning to work on hardening my website against cross site request
> forgeries. I use CGI.pm.
> 
> My question is, how can I tell, using CGI.pm,  if this webpage was invoked
> with a GET or POST method?

	You're probably intersted in:  $q->request_method

	It should also be available in an environment variable of the same 
name:  $ENV{'REQUEST_METHOD'}

Randolf Richardson - randolf@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com