Spring Boot Day 9
On the 9th day of spring boot learning, I learned about the fundamentals of API and REST also methods of HTTP along with standard status code:
an API (Application Programming Interface) is like a waiter that takes your request, communicates with a server, and returns the server's response back to you in a format you can understand, allowing you to access or interact with the server's functionalities and data.
Imagine you're at a restaurant, and you want to order some food. In this scenario:
You (the client) are the one who wants to order food.
The waiter (the API) is the intermediary that takes your order and communicates it to the kitchen (the server).
The kitchen (the server) is where the actual food preparation happens.
Here's how the API process works in a simpler way:
You (the client) look at the menu (API documentation) to see what options (endpoints) are available for ordering food.
You decide what food you want (the specific API endpoint and parameters you need).
You call the waiter (make an API request) and tell them what you want, providing any additional details like how you want your food cooked (request headers, query parameters, or request body).
The waiter (API) takes your order and communicates it to the kitchen (the server).
The kitchen (the server) processes your order, prepares the food, and gives it back to the waiter (API).
The waiter (API) brings the food to you (the client) and presents it in a format you can understand (usually JSON or XML).
You (the client) enjoy your delicious meal (consume the data sent by the API).