官术网_书友最值得收藏!

DELETE and OPTIONS

The DELETE API method is used to delete a resource from the database. It is similar to PUT but without any body. It just needs an ID of the resource to be deleted. Once a resource gets deleted, subsequent GET requests return a 404 not found status. 

Responses to this method are not cacheable (in case caching is implemented)  because the DELETE method is idempotent.

The OPTIONS API method is the most underrated in the API development. Given the resource, this method tries to know all possible methods (GET, POST, and so on) defined on the server. It is like looking at the menu card at a restaurant and then ordering an item which is available (whereas if you randomly order a dish, the waiter will tell you it is not available). It is best practice to implement the OPTIONS method on the server. From the client, make sure OPTIONS is called first, and if the method is available, then proceed with it. 

主站蜘蛛池模板: 田阳县| 青海省| 湛江市| 东光县| 建水县| 普宁市| 江城| 屯门区| 宜城市| 双鸭山市| 楚雄市| 交城县| 崇州市| 乌拉特中旗| 襄垣县| 南投县| 漯河市| 平安县| 肥东县| 明溪县| 江口县| 安塞县| 扶风县| 通州区| 贵溪市| 小金县| 商南县| 通道| 宁蒗| 青田县| 蒙阴县| 崇左市| 尼木县| 松潘县| 新和县| 志丹县| 利川市| 汨罗市| 咸丰县| 承德市| 中超|