Representational State Transfer refers to a group of software architecture design constraints that bring about efficient, reliable, and scalable systems.
- Get
- Post
- Put
- Patch
- Delete
- Options
- Head
Get requests may contain the following
- Host
- Content Type
- Authorization
- Cache Control
Example of GET request in JSON format
Response usually contains
- Required : True/false
- Description
- Type
DELETE request, _If force=true is given in the URL, then post will be completely deleted. If just delete request is passed, then it will be sitting in the trash bin. Content type should match in GET and POST request Same URI for GET and POST
- POST: Create new resource.
- PUT: Contains ID and content.(Updating an existing resource and may allow it to create a new resource.)
- PATCH: Modify the existing resource using ID.
- DELETE: Deleting data based on ID
-
OPTIONS: Creates description of the resource.
-
HEAD: retrieves the head section of the response.
STATUS CODES:
- 1XX - Information
- 2XX - Success
- 3XX - Redirection
- 4XX - Client Error
- 5XX - Server Error