Menu

#222 Support PATCH Method as Described in RFC 5789

Latest SVN
closed
None
1
2015-06-29
2014-09-23
Patrick
No

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 )

Discussion

  • Marc Guillemot

    Marc Guillemot - 2014-09-23

    How would you use it in a "normal" browser?

     
    • Patrick

      Patrick - 2014-10-24

      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.

       
  • Patrick

    Patrick - 2014-10-24

    message removed... didn't see replay button, sorry

     

    Last edit: Patrick 2014-10-24
  • Joerg Werner

    Joerg Werner - 2015-06-29

    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!

     
  • Ahmed Ashour

    Ahmed Ashour - 2015-06-29
    • status: open --> accepted
    • assigned_to: Ahmed Ashour
     
  • Ahmed Ashour

    Ahmed Ashour - 2015-06-29

    You have a case, You Win!

    Thanks a lot Joerg for the patch, which was committed in SVN.

     
  • Ahmed Ashour

    Ahmed Ashour - 2015-06-29
    • status: accepted --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.