简体   繁体   中英

Separate GET parameters from POST in embedded Jetty server

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM