Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

request.getParameter("") for only "POST" ???

Status
Not open for further replies.

fuadhamidov

Programmer
Sep 22, 2003
98
TR
hi

i want to get Parameter that is "sent" by POST mehtod. i type
request.getParameter("...");
but it doesn't differ post from get method.
I know asp has this feauture and i believe jsp should have that kind of feature.

i need it to test my java application that create connection and send parameter by only post method.
 
request.getMethod(), "Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT."

but if a request contain both POST and GET parameter, and you want to know if a particular parameter is from GET or POST, you may need to check if a parameter is in request.getQueryString().
 
To add, do you mean retrieving data sent in a POST, such as a file byte data or an xml message ? If so you retrieve this by doing

InputStream is = request.getInputStream();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top