What is an API, the purpose of API, GET, POST?
Rukon Uddin
08/25/2024What is an API?
API is the acronym for Application Programming Interface. It is a means of exchanging data. When we use an application on a mobile phone or computer, the application is connected to the Internet, and data is sent or a request is sent to a server. And the way that work is done is API.
What is the purpose of API?
The purpose of the API is to transfer data from the client site to the server-side, and this is done via HTTP.
How an API works?
API work by sharing data and information between applications, systems, and devices making it possible to communicate with each other. Sometimes the easiest way to think about APIs is to think of a metaphor, and a common scenario that many people use is the customer, a waiter, and the kitchen of a restaurant: a customer talks to the waiter and tells the waiter what he wants.
The waiter dropped the order and contacted the kitchen. The kitchen does their work, prepares the food and then the waiter returns the order to the customer. In this metaphor, a customer is like a user who tells the waiter what he wants.
The waiter, like an API, accepts the customer's order and translates the order into easy-to-follow instructions that the kitchen uses to fulfill that order often following a specific code or input that the kitchen can easily recognize. The kitchen is like a server that works to create order in the way the customer wants it, hopefully! When the meal is ready, the waiter picks up the order and undefined Delivers to the customer. undefined
Purpose of GET:
And GET is the method of bringing data from the server-side to the client site. Get is what I want so he will give.
Purpose of POST:
The purpose of the POST Method is to take requests from client sites to store data on server sites.
Purpose of PUT:
The purpose of PUT is to request that any data stored on the server site be updated. If we need to update any data stored on a server site later, we update the data on the server site via a PUT request.
Purpose of DELETE:
The purpose of the Delete method is to take a request from the clean site to delete any data from the server site.