You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Firestar <th...@yahoo.com> on 2001/10/16 09:52:51 UTC

How to get the Request Method

Hi, I would like to know how to obtain the http
request method from the browser/client, whether it's a
GET or POST method. I used the following code:

req.getHeader("REQUEST_METHOD")

However this method returns a NULL when used with
Tomcat 4.0.1 (Standalone - unpacked from the win32
binary dist). This method works ok with JRun 3.1. What
could be the reason? Thanks in advance.

Regards,
Firestar

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Re: How to get the Request Method

Posted by asheesh <as...@q2aindia.com>.
use
request.getMethod();

regards
asheesh

----- Original Message ----- 
From: Firestar <th...@yahoo.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, October 16, 2001 3:52 PM
Subject: How to get the Request Method


> Hi, I would like to know how to obtain the http
> request method from the browser/client, whether it's a
> GET or POST method. I used the following code:
> 
> req.getHeader("REQUEST_METHOD")
> 
> However this method returns a NULL when used with
> Tomcat 4.0.1 (Standalone - unpacked from the win32
> binary dist). This method works ok with JRun 3.1. What
> could be the reason? Thanks in advance.
> 
> Regards,
> Firestar
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 


Re: How to get the Request Method

Posted by Lester June Cabrera <le...@vinciworks.com>.
In your JSP page, use

<%= request.getMethod() %>


At 12:52 AM 10/16/01 -0700, you wrote:
>Hi, I would like to know how to obtain the http
>request method from the browser/client, whether it's a
>GET or POST method. I used the following code:
>
>req.getHeader("REQUEST_METHOD")
>
>However this method returns a NULL when used with
>Tomcat 4.0.1 (Standalone - unpacked from the win32
>binary dist). This method works ok with JRun 3.1. What
>could be the reason? Thanks in advance.
>
>Regards,
>Firestar
>
>__________________________________________________
>Do You Yahoo!?
>Make a great connection at Yahoo! Personals.
>http://personals.yahoo.com


AW: How to get the Request Method

Posted by Maik Schreiber <bZ...@iq-computing.de>.
>Hi, I would like to know how to obtain the http
>request method from the browser/client, whether it's a
>GET or POST method. I used the following code:
>
>req.getHeader("REQUEST_METHOD")
>
>However this method returns a NULL when used with
>Tomcat 4.0.1 (Standalone - unpacked from the win32
>binary dist). This method works ok with JRun 3.1. What
>could be the reason? Thanks in advance.

HttpServletRequest.getMethod()

RTFM

-- 
Maik Schreiber
IQ Computing - http://www.iq-computing.de
mailto: info@iq-computing.de