Skip to content

Http methods

Raphaël Balet edited this page Jan 27, 2025 · 4 revisions

The URL is a sentence, where resources are nouns and hTTP methods are verbes

GET

  • Requests data from the resource and should not produce any side effects.
GET /companies/3/employees // returns list of all employees from company 3

POST

  • Create a resource in the database, mostly when a web form is submitted.
  • Is non-idempotent
POST /companies/3/employees // creates a new Employee of company 3.

PUT

  • Updates resource or creates the resource, if it doesn't exist.
PUT /companies/3/employees/4 // request the server to update, or create if doesn't exist

DELETE

  • Removes a resource from the database or its instance
DELETE /companies/3/employees/4 // will request the server to delete john resource from the employees
Clone this wiki locally