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

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. 

主站蜘蛛池模板: 巴楚县| 乐山市| 鄂托克前旗| 梁河县| 克东县| 临汾市| 灵武市| 昌乐县| 彰化市| 宿州市| 昭觉县| 浦江县| 丽江市| 霍州市| 萝北县| 武宁县| 汉阴县| 盖州市| 双桥区| 资溪县| 资源县| 安西县| 彭阳县| 汉中市| 镶黄旗| 全南县| 铁岭市| 兴安盟| 德令哈市| 鹤岗市| 松原市| 涟水县| 盱眙县| 宿州市| 南川市| 铅山县| 江西省| 育儿| 浪卡子县| 筠连县| 金寨县|