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

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. 

主站蜘蛛池模板: 宣汉县| 揭西县| 栾城县| 油尖旺区| 义马市| 宣汉县| 湟源县| 朔州市| 临夏县| 方山县| 青冈县| 桦甸市| 桦南县| 华容县| 巫溪县| 新昌县| 武胜县| 灵台县| 万源市| 石棉县| 大冶市| 呼图壁县| 扎囊县| 虹口区| 昆山市| 南江县| 明光市| 兴城市| 将乐县| 谷城县| 武宁县| 阿瓦提县| 凤山县| 玉林市| 万荣县| 绥阳县| 伊金霍洛旗| 松滋市| 乐陵市| 阿巴嘎旗| 阿巴嘎旗|