TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PATCH Method for HTTP

63 pointsby dotpotalmost 13 years ago

7 comments

scott_walmost 13 years ago
It's a shame that Patch isn't idempotent.<p>My preference for updating data across the web is to send only the information that is different, and the service ensures everything else remains the same. Put doesn't quite cut it in this case (technically, it's supposed to completely replace a resource).<p>Are there any advantages for declaring Patch to be not idempotent? I'm assuming it allows appending to a single resource?
评论 #4199125 未加载
评论 #4198961 未加载
评论 #4199253 未加载
评论 #4198890 未加载
评论 #4200348 未加载
评论 #4199043 未加载
评论 #4199243 未加载
Arnoutalmost 13 years ago
Now annoyingly the ELB on AWS just bounces PATCH requests with a 405 Method Not Allowed. Our services are affected by this and I noticed there is a bug open over at Heroku regarding the same issue. It's something Amazon don't document though so you only find out through testing after you already created your planned stack...
评论 #4199299 未加载
tamasnetalmost 13 years ago
While this is certainly makes the request's intent more clear, I suspect there isn't much gained here over simply POSTing the patch content. Other request methods can be implemented by the HTTP server itself in terms of the filesystem (e.g. PUT "simply" writes the content stream to a local file), but PATCH would require the server itself to have specific knowledge of the patch format and how to apply it in order to be useful. This could be farmed out a plugin or external program, but such a thing could just as easily live as a POST processor in [insert favourite language here] without needing to make any changes to the HTTP server or standards.
almostalmost 13 years ago
I gave a short presentation (5 minutes) about the PATCH verb and RESTful APIs at local user group last year. Possibly someone will find the slide useful (or just enjoy the kitten pictures ;p):<p><a href="http://almostobsolete.net/talks/http_rest_patch_kittens/" rel="nofollow">http://almostobsolete.net/talks/http_rest_patch_kittens/</a>
sjtgrahamalmost 13 years ago
Can somewhere point me to the part of RFC 2616 that says "The PUT method is already defined to overwrite a resource with a complete new body, and cannot be reused to do partial changes."
评论 #4202066 未加载
munkydungalmost 13 years ago
PATCH will be supported in Rails <a href="http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/" rel="nofollow">http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-...</a>
einhverfralmost 13 years ago
I can't wait to submit HTML forms with a PATCH method ;-)
评论 #4200397 未加载
评论 #4199970 未加载