Most developers are familiar with HTTP verbs/methods. Because of this, understanding REST API methods is quite simple to wrap your head around. REST APIs use the standard HTTP methods that developers (and most technical people) already know. With REST, each method is intended to perform specific functions:
- GET: This API method requests data from a specified resource. It should only retrieve data and should have no other effect.
- POST: This API method sends data to the server for creation. It is often used when uploading a file or submitting a completed web form.
- PUT: This API method updates all current representations of the target resource with the uploaded content.
- DELETE: As the name suggests, this method removes/deletes a specified resource.
- HEAD: Similar to GET, this method only transfers the status line and the header section.
- PATCH: This method applies partial modifications to a resource.
Each method corresponds to the CRUD (Create, Read, Update, Delete) operations in database management. Understanding each of the methods above is crucial for designing a RESTful API.
Leave a Reply