In Java servlets you read a JSON from a POST request e.g. via
new JSONObject(toString(httpRequest.getInputStream()))
Now additionally to the JSON I would like to specify parameters in the URL, they can be read via:
httpRequest.getParameterMap().get("someURLParam")
All is working (I'm using AJAX post requests and jetty for server side)
BUT
I'm concerned and confused if and when these two methods influence each other as the javadocs from javax.servlet.ServletRequest.getParamter(String)
says:
If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via ServletRequest.getInputStream or ServletRequest.getReader can interfere with the execution of this method.
What does it mean in my case? Or do they only interfere if content type is x-www-form-urlencoded
? Or only if using getParameter
and the method getParameterMap
is fine?