What are the HTTP Methods?

DWQA QuestionsCategory: Web Design HTMLWhat are the HTTP Methods?
Editor Staff asked 1 month ago

What are the HTTP Methods?

1 Answers
Editor Staff answered 1 month ago

HTTP Methods are also known as HTTP Verbs. They form a major portion of uniform interface restriction followed by the REST that specifies what action has to be followed to get the requested resource. Below are some examples of HTTP Methods:

  • GET: This is used for fetching details from the server and is basically a read-only operation.
  • POST: This method is used for the creation of new resources on the server.
  • PUT: This method is used to update the old/existing resource on the server or to replace the resource.
  • DELETE: This method is used to delete the resource on the server.
  • PATCH: This is used for modifying the resource on the server.
  • OPTIONS: This fetches the list of supported options of resources present on the server.

The POST, GET, PUT, DELETE corresponds to the create, read, update, delete operations which are most commonly called CRUD
 
GET, HEAD, OPTIONS are safe and idempotent methods whereas PUT and DELETE methods are only idempotent. POST and PATCH methods are neither safe nor idempotent.