About Lesson
What is an API?
- API stands for Application Programming Interface.
- It allows two applications to communicate with each other.
- Example: When you use a food delivery app, it fetches restaurant data from a server using an API.
What is REST API?
- REST (Representational State Transfer) is an architectural style used for building web services.
- REST APIs allow communication between a client (e.g., a web browser, mobile app) and a server.
- It uses HTTP methods like GET, POST, PUT, DELETE to interact with data.
🔹Real-Life Example of REST API
- Think of a restaurant:
- A customer (client) orders food from a waiter (API).
- The waiter goes to the kitchen (server) and brings back the food.
- The customer does not need to know how the kitchen works, they just request and receive.
- Similarly, a REST API fetches data from a server when requested.