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:

  1. You (the client) are the one who wants to order food.

  2. The waiter (the API) is the intermediary that takes your order and communicates it to the kitchen (the server).

  3. The kitchen (the server) is where the actual food preparation happens.

Here's how the API process works in a simpler way:

  1. You (the client) look at the menu (API documentation) to see what options (endpoints) are available for ordering food.

  2. You decide what food you want (the specific API endpoint and parameters you need).

  3. 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).

  4. The waiter (API) takes your order and communicates it to the kitchen (the server).

  5. The kitchen (the server) processes your order, prepares the food, and gives it back to the waiter (API).

  6. The waiter (API) brings the food to you (the client) and presents it in a format you can understand (usually JSON or XML).

  7. You (the client) enjoy your delicious meal (consume the data sent by the API).