Refers to the application programming interface, which is some predefined functions, or refers to the convention of connecting different components of the software system.
Used to provide a set of routines that applications and developers can access based on a piece of software or hardware without accessing the source code or knowing the details of the internal working mechanism.
We can realize specific functions through API interface without knowing the details of its internal implementation. The API interface can be understood as the encapsulation of a specific service, and the service is encapsulated for others to call, so that many functions do not need to be redeveloped.
How does api access personal web pages?
This kind of access requires a programmer and his computer. Just before calling, you must know what the API interface is, which is familiar to everyone. It is just some predefined functions that encapsulate some programs with certain functions and can be applied by calling this interface.
The next step is to choose the platform to call the API interface of the web page. For example, if you choose to aggregate data, you must first register official website's account, aggregate data, and select the API interface to be called by your enterprise.
How does api interface connect web pages?
The steps are as follows:
1. First, we need to determine the basic information of the third-party interface: address, request method, parameters and return value. Interface mode The third party's interface is restful, and it adopts get request.
2. After determining the relevant mode of the interface, write an http request and construct the request with parameters and request mode.
3. The most important request for constructing http is to use CloseableHttpClient, set related header, and use HttpResponse to accept the return value of users.
4. In the business class, you only need to encapsulate the related request and pass the parameters to the interface.
How does api interface access its own web page?
The steps are as follows:
1. First, we need to determine the basic information of the third-party interface: address, request method, parameters and return value. Interface mode The third party's interface is restful, and it adopts get request.
2. After determining the relevant mode of the interface, write an http request and construct the request with parameters and request mode.
3. The most important request for constructing http is to use CloseableHttpClient, set related header, and use HttpResponse to accept the return value of users.
4. In the business class, you only need to encapsulate the related request and pass the parameters to the interface.