I have some javascript that uses PUT requests and I'd like to be able to use request.getParameter() to read in variables. I know that Java EE does not parse stuff from PUT requests because HTML PUT was originally intended for file upload. However I am wondering if there is a way to force this behavior anyway or at a minimum how to access the parser Tomcat uses when it parses requests for POST and run it myself on the raw request string.
Thanks.
The solution appears to be to add the following attribute to the Connector element of server.xml:
parseBodyMethods="POST, PUT"
This tells Tomcat to treat PUT requests like POST requests with respect to parsing the body.
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