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

DELETE and OPTIONS

The DELETE API method is used to delete a resource from the database. It is similar to PUT but without a 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 (should caching be implemented) because the  DELETE method is idempotent.

The OPTIONS API method is the most underrated in API development. Given the resource, this method tries to find 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 that 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. 

主站蜘蛛池模板: 开阳县| 积石山| 诸暨市| 克东县| 蓬溪县| 湘阴县| 汕尾市| 嘉祥县| 黑山县| 广东省| 宝应县| 洛浦县| 遂川县| 贵南县| 嘉善县| 三门县| 清水河县| 汝州市| 湘乡市| 青河县| 长泰县| 湘阴县| 尚志市| 延寿县| 贵溪市| 北宁市| 平安县| 石屏县| 黄浦区| 西盟| 尤溪县| 南川市| 海门市| 酒泉市| 镶黄旗| 东安县| 香港| 焦作市| 平遥县| 大安市| 津市市|