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

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. 

主站蜘蛛池模板: 祁阳县| 凉城县| 隆安县| 清涧县| 吉首市| 鹤岗市| 墨脱县| 福贡县| 兰西县| 眉山市| 新昌县| 奇台县| 赣州市| 锦屏县| 安阳市| 绿春县| 庄河市| 宁德市| 萝北县| 防城港市| 深泽县| 江西省| 莆田市| 新宁县| 昂仁县| 改则县| 榆林市| 安龙县| 沙田区| 辽源市| 盐城市| 凌源市| 黎城县| 繁昌县| 本溪市| 金秀| 从江县| 田阳县| 武平县| 兴和县| 盐津县|