I have an HttpServlet that is trying to handle a PUT request, that has some form parameters (sent with a "application/x-www-form-urlencoded" header). I have the same setup working fine for POST, but for some reason a PUT request turns up emptywhen I ask for the parameters:
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws {
Map<String,String[]> params = req.getParameterMap();
System.out.println(params.size());
}
the size of params is 0 even though I am passing parameters in.
Is there some other way to read params for a PUT request?
See the the following SO question, seems to answer your question:
Servlet parameters and doPut
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With