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

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. 

主站蜘蛛池模板: 吕梁市| 清远市| 商都县| 吴川市| 宜川县| 花莲市| 柏乡县| 深水埗区| 东乌珠穆沁旗| 渭源县| 修水县| 襄城县| 鄂伦春自治旗| 胶州市| 上蔡县| 洞头县| 泰州市| 大连市| 德昌县| 铜山县| 木兰县| 托克托县| 开阳县| 乐安县| 宜君县| 叙永县| 松阳县| 富锦市| 军事| 来宾市| 长丰县| 梓潼县| 延寿县| 盐边县| 辽源市| 东兴市| 灵寿县| 滨州市| 西昌市| 邻水| 三江|