I've created a simple web service using JRuby 1.7.4, Sinatra 1.4.4 and Rack 1.5.2. This web service responds to GET, POST, PATCH and DELETE requests with a simple message "Hello world using [request-type]".
I started Rack and tested all the request types. All four worked.
I used Warbler to create a war file of the application and deployed it to Tomcat 7.0.47. When I tested with Tomcat PATCH failed with a "HTTP Status 501 - Method PATCH is not is not implemented by this servlet for this URI". (Yes, 'is not' is repeated. But this is the response I get from Tomcat.) GET, POST and DELETE worked fine.
I then tried using Jetty 9.1.0. Same result. GET, POST and DELETE work but PATCH fails.
Why are PATCH requests failing and how do I get them to work with this set up?
According to Tomcat documentation HttpServlet can handle only GET, POST, PUT, DELETE requests
But you can find this useful:
For example, to update an Account, this will work with an actual POST request: