RestAPI
RestAPI
REST API stands for REpresentational State Transfer API. It is a type of API (Application
Programming Interface) that allows communication between different systems over the
internet.
REST APIs work by sending requests and receiving responses, typically in JSON format,
between the client and server.
REST APIs use HTTP methods (such as GET, POST, PUT, DELETE) to define actions that can
be performed on resources. These methods align with CRUD (Create, R=ead, Update, Delete)
operations, which are used to manipulate resources over the web.
Key Features of REST APIs
● Stateless: Each request from a client to a server must contain all the information the
server needs to fulfill the request. No session state is stored on the server.
● Cacheable: Responses from the server can be explicitly marked as cacheable or non-
cacheable to improve performance.
● Uniform Interface: REST APIs follow a set of conventions and constraints, such as
consistent URL paths, standardized HTTP methods, and status codes, to ensure
smooth communication.
● Layered System: REST APIs can be deployed on multiple layers, which helps with
scalability and security.
Applications of REST APIs
app.use(express.json());
Sample
)https://www.mongodb.com/resources/languages/express-mongodb-rest-api-tutorial