Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
800 views
in Technique[技术] by (71.8m points)

rest - HTTP PATCH support in browsers

I am designing REST endpoints for my application and i need to use PATCH for a few of the endpoints. Will all browsers that support HTTP/1.1 be able to support the PATCH ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

HTTP/1.1 did not define the PATCH method.

HTTP/1.1 does leave itself open for clients and/or servers to add new methods.

RFC 5789 defined the conventions for using the PATCH method.

The method defined within a HTTP request is nothing more than a string. Browsers should allow JavaScript to use whatever HTTP method it wants in the XmlHttpRequest; see this Q&A for more info. In short, any modern browser will allow you to do this, i.e. IE9+ and Firefox/Chrome/Safari/Opera/Spartan from the last few years.

Also, don't forget the server needs to specifically handle the PATCH method too, it doesn't just magically happen.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...