Application Programming Interface.
REpresentational State Transfer.
Create Read Update Delete
- Create - POST
- Read - GET
- Update - PUT/PATCH
- Delete - DELETE
In regards to its use in RESTful APIs, CRUD is the standardized use of HTTP Action Verbs.
This means that if you want to create a new record you should be using “POST”. If you want to read a record, you should be using “GET”. To update a record use “PUT” or “PATCH”, And to delete a record, use “DELETE”.
Below are the various types of HTTP Verbs
A POST request is utilized to send data to a server to create a resource, for example, customer information, file upload, etc. usually using HTML Forms.
The GET method is used to retrieve specific resource. Requests using GET should only retrieve data and should have no other effect on the data.
PUT is similar to POST as it is used to send data to the server to create or update a resource. The difference between it replaces all current representations of the target resource with the uploaded content.
The PATCH method is used for making partial changes to an existing resource. The PATCH method provides an entity containing a list of changes to be applied to the resource requested using the URI.
As it sounds, the DELETE request method is used to delete resources indicated by a specific URI. Making a DELETE request will remove the targeted resource.
PUT method uses the request URI to supply a modified version of the requested resource which replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource.