Reputation: 119
I need to know wheather the parameter is GET or POST but in handle
method request.getParameter(name)
gives me all parameters. Is it possible to do something like request.getGETParameter(name)
and request.getPOSTParameter(name)
or do I have to parse raw data myself?
Upvotes: 0
Views: 1383
Reputation: 837
There is no such thing as GET parameters and POST parameters. GET and POST are methods of HTTP request. You can find out which method your request is by calling
public String getMethod();
on your request. You might also want to take a look on the description of HTTP protocol http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol The difference between parameters being sent in GET in and POST method is that in GET request parameters are sent in query string, and in POST request these are sent in request body.
Upvotes: 2