Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New HTTP PATCH method!

William Brogden
Author and all-around good cowpoke
Posts: 13074
  • 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 is neither safe nor idempotent as defined by [RFC2616], Section

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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic