ABSTRACT
Several applications extending the Hypertext Transfer Protocol (HTTP)
require a feature to do partial resource modification. The existing
HTTP PUT method only allows a complete replacement of a document.
This proposal adds a new HTTP method, PATCH, to modify an existing
HTTP resource.
http://tools.ietf.org/html/rfc5789
Additional Information:
This only means that PATCH needs to be part of the list of allowed HTTP methods ( enum com.gargoylesoftware.htmlunit.HttpMethod )
How would you use it in a "normal" browser?
How would you use PUT and DELETE in a "normal" browser? PATCH just completes the set of the currently supported HTTP methods. The purpose of this method is already part of the description.
I use XLT which is build on top of HtmlUnit to load test a REST service. PATCH is currently the only method (of those that I need to test) that is not supported and I frequently have to work around that.
message removed... didn't see replay button, sorry
Last edit: Patrick 2014-10-24
I see the need for PATCH as well. More and more companies design their web services to follow the REST principles, which advocate to use the PATCH method for partial document updates.
If the data behind the web service is maintained via an HTML-based front-end applications running in the browser, the support of PATCH in the browser is crucial. Modern browsers allow to use PATCH as the request method when submitting XHRs. Would be great if HtmlUnit could support the PATCH method, too.
The required changes to support PATCH are rather small. Since the underlying HttpClient supports PATCH already, it is all about making PATCH a known HTTP method and allowing to set a request body for it. Please find attached a patch with the necessary changes.
Please let me know your thoughts. Thanks!
You have a case, You Win!
Thanks a lot Joerg for the patch, which was committed in SVN.