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

HTTP methods

Based on HTTP 1.1 specifications, the following are method definitions:

  • GET: This method gets the information mentioned in the URI. The GET method can be used for single or multiple items.
  • POST: This method creates the item mentioned in the URI. Generally, the POST method will be used for item creation and more secured options. As the parameters are hidden in POST, it will be secure compared to the GET method.
  • DELETE: This methods deletes the item in the requested URI.
  • PUT: This method updates the item in the requested URI. According to the HTTP specifications, the server can create the item if the item is not available. However, this will be decided by the developer who designed the application.
  • Advanced HTTP methods: Though we may not use advanced methods all the time, it will be good to know these methods, as they might be useful:
    • HEAD: This method gets meta information about the resource, not the resource itself, as a response. It will be used for caching purposes.
    • TRACE: This method is mostly used for debugging purposes where the contents of an HTTP request will be sent back to the requester.
    • CONNECT: This is used to open a tunnel and can be used for proxy purposes.
    • OPTIONS: This method is used to describe communication options for the target resource.

The following are HTTP method recommendations for our CRUD operations:

In the rest of the chapter, we will show how to build CRUD operations.

主站蜘蛛池模板: 彭山县| 夏邑县| 银川市| 新源县| 罗田县| 杂多县| 农安县| 漳平市| 临湘市| 延长县| 磴口县| 香河县| 天镇县| 桐庐县| 旅游| 托克托县| 仪征市| 富蕴县| 庄浪县| 荣昌县| 博爱县| 大庆市| 阜康市| 西充县| 许昌市| 秦皇岛市| 开原市| 乌鲁木齐市| 英吉沙县| 新化县| 仙桃市| 滦南县| 峨眉山市| 宝山区| 娄烦县| 浠水县| 姚安县| 宁安市| 清远市| 麦盖提县| 敦化市|