askvity

How Many Methods Are in HTTP?

Published in HTTP Methods 3 mins read

There are 9 standard, registered HTTP methods that are widely recognized and defined within HTTP specifications (like RFC 9110 and related RFCs).

Standard HTTP Methods

While the reference highlights the most frequently used ones, the full set of standard HTTP request methods includes:

  • GET: Requests a representation of the specified resource. Requests using GET should only retrieve data.
  • HEAD: Asks for a response identical to a GET request, but without the response body. Useful for retrieving header information without transferring the whole content.
  • POST: Submits an entity to the specified resource, often causing a change in state or side effects on the server. Commonly used for sending data like form submissions.
  • PUT: Replaces all current representations of the target resource with the request payload.
  • DELETE: Deletes the specified resource.
  • CONNECT: Establishes a tunnel to the server identified by the target resource. Used for proxying SSL/TLS.
  • OPTIONS: Describes the communication options for the target resource. Clients can use this to determine the methods allowed by the server for a resource.
  • TRACE: Performs a message loop-back test along the path to the target resource. Useful for debugging connection issues.
  • PATCH: Applies partial modifications to a resource.

Commonly Used Methods (Based on Reference)

As noted in the provided reference from doc.oroinc.com: "The primary or commonly-used HTTP methods are POST, GET, PUT, PATCH, and DELETE. These methods correspond to create, read, update, and delete (or CRUD) operations, respectively."

These five methods are indeed the workhorses of web development, mapping closely to the fundamental operations performed on data resources in many applications.

Let's look at how these primary methods typically map to CRUD operations:

HTTP Method CRUD Operation Description
POST Create Submit data to create a new resource.
GET Read Retrieve data for a resource.
PUT Update (Full) Replace an existing resource entirely.
PATCH Update (Partial) Apply partial modifications to a resource.
DELETE Delete Remove a specific resource.

This mapping is a widely accepted convention in designing RESTful APIs, providing a clear and consistent way to interact with web resources.

While there are 9 standard methods, the 5 methods listed in the reference are those most frequently encountered in typical web development and API interactions, particularly when dealing with data manipulation tasks.

Related Articles