Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

New HTTP PATCH method!  RSS feed

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other day I was surprised to see a discussion in the Jersey mailing list for implementing the PATCH method!

Yow, I didn't even know there was a HTTP PATCH method but it turns out that the IETF has been mulling it for years and RFC5789 was released in March 2010, defined for HTTP 1.1. To quote the RFC:

The difference between the PUT and PATCH requests is reflected in the
way the server processes the enclosed entity to modify the resource
identified by the Request-URI. In a PUT request, the enclosed entity
is considered to be a modified version of the resource stored on the
origin server, and the client is requesting that the stored version
be replaced. With PATCH, however, the enclosed entity contains a set
of instructions describing how a resource currently residing on the
origin server should be modified to produce a new version. The PATCH
method affects the resource identified by the Request-URI, and it
also MAY have side effects on other resources; i.e., new resources
may be created, or existing ones modified, by the application of a
PATCH.
PATCH is neither safe nor idempotent as defined by [RFC2616], Section
9.1.


I have seen some arguments that this is just an unneeded complication and that POST should cover modification of a resource. The RFC makes no attempt to define formats for PATCHing.

Anyway, I can certainly see the application for RESTful web services so I wanted to call your attention to it.

Link to the rfc5789 page at IETF.

Bill
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!