-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
- Requests data from the resource and should not produce any side effects.
GET /companies/3/employees // returns list of all employees from company 3
- 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.
- 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
- 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