What is an API interface and what does it mean specifically?
As a software application, many resources and data are not necessarily provided by itself. Some functions still need to call services provided by third parties, which involves calling API interfaces.
What is an API interface?
API refers to the application programming interface. We can implement specific functions through the API interface without knowing its internal implementation details. The API interface can be understood as an encapsulation of a specific service. The service is encapsulated and provided for others to call. In this way, many functions do not need to be developed from scratch.
For example, we want to know what the weather is like for a week. It is difficult to implement this function by ourselves, because only the meteorological department knows the weather data. So how do you know weather information? The meteorological part provides data API for us to use. As long as we enter the region, we will know the weather conditions of the region for a week, but we do not need to understand how the weather forecast is implemented.
In addition, data communication between different systems and programming languages often uses APIs for data handover.
What are the common API forms?
As we mentioned above, API is actually an encapsulation of a type of service. We can use different programming languages to write APIs. Differences in development habits and programming languages lead to differences in API styles. Common APIs have the following forms:
1. HTTP type interface
APIs provided based on the HTTP protocol. This type of API is often provided in the form of a "website address", as is now mainstream RESTful belongs to this type of interface.
2. RPC interface
RPC refers to remote procedure call. Part of the code logic is deployed on the remote server, and then called where needed (calling the remote method is Like calling local methods), it is essentially a Client/Server model and supports multiple protocols and data transmission methods.
3. WebService interface
WebService does not specifically refer to a certain API. We call services provided in the form of WEB WebService, such as RESTful, which also belongs to WebService.