TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PATCH Method for HTTP

63 点作者 dotpot将近 13 年前

7 条评论

scott_w将近 13 年前
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 未加载
Arnout将近 13 年前
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 未加载
tamasnet将近 13 年前
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.
almost将近 13 年前
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>
sjtgraham将近 13 年前
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 未加载
munkydung将近 13 年前
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>
einhverfr将近 13 年前
I can't wait to submit HTML forms with a PATCH method ;-)
评论 #4200397 未加载
评论 #4199970 未加载