Using HTTP methods

The HTTP specification also dictated that HTTP requests must contain a verb, and laid out rules for which verbs can be used for what types of request:

  • GET: Requests the retrieval of a resource.
  • POST: Requests where the server decides how to process the data. The URL specifies the resource that is to handle this request.
  • PUT: Requests for the entity to be stored under the specified URL.
  • PATCH: Requests for partial changes to be made to an existing resource.
  • DELETE: Requests for the resource to be deleted.
  • HEAD: Requests for the metadata of a resource.
  • OPTIONS: Requests for information from the server regarding what requests are allowed.

Furthermore, GET, HEADOPTIONS, and TRACE are considered to be safe methods, which ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.