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

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.

主站蜘蛛池模板: 凤凰县| 广水市| 长汀县| 蒙阴县| 吉安市| 平顺县| 正阳县| 新郑市| 漳浦县| 霍州市| 仲巴县| 南皮县| 察哈| 葫芦岛市| 措美县| 张家港市| 陕西省| 厦门市| 汕头市| 玉田县| 商丘市| 虞城县| 灵川县| 昭觉县| 谢通门县| 泰安市| 海林市| 沁水县| 河池市| 丹寨县| 泾阳县| 喜德县| 马龙县| 榆林市| 广丰县| 永安市| 曲沃县| 梁平县| 勐海县| 遂平县| 乌苏市|