You have already used different HTTP methods from your frontend code.
APIs use different HTTP methods to perform actions:
- GET: Retrieve data from the server
- POST: Send new data to the server
- PUT: Replace existing data on the server (full update)
- PATCH: Update part of an existing resource (partial update)
- DELETE: Remove data from the server
Note: PUT is usually used to replace an entire resource, while PATCH is used to update only some fields of a resource.
In this lesson, we will focus only on GET requests.