HTTP Methods Used in API
GET Method
- Retrieves information from the system.
- Used to fetch resources from a server specified by the given URI or URL.
POST Method
- Creates new resources on the server.
- Used for submitting data to be processed to a specified resource.
PUT Method
- Updates the database with an entirely new entry or replaces the previous resource with a new one.
- Used for creating a new resource or replacing an existing resource entirely.
PATCH Method
- Partially updates an existing resource.
- Used when only specific parts of a resource need to be modified, rather than replacing the entire resource.
DELETE Method
- Removes an existing resource from the server.
- Used to delete a resource identified by the given URI.
What is REST API in Node.js ?
REST (Representational State Transfer) is an architectural style for designing networked applications. A RESTful API is an API that adheres to the principles of REST, making it easy to interact with and understand. In this article, we’ll explore what REST API is in the context of Node.js, its principles, and how to create one.
Table of Content
- Understanding REST API
- Principles of REST API
- HTTP Methods Used in API
- Understanding PUT and PATCH
- Conclusion