[Reserved] you to use the vernacular science, in the end what is the API

Transfer:
https://baijiahao.baidu.com/s?id=1597881116201407882&wfr=spider&for=pc

Editor:
What is API? If you search on Baidu Encyclopedia, you will get the following results: API (Application Programming Interface, Application Programming Interface) is the number of pre-defined function in order to provide the application developer based on a software or hardware to access a group of patients the ability to process, but without having to access the source code, or to understand the details of the inner workings. Then again Popular point, API what is it?

Before I learned software development, API sounds like a beer. And now, I began to frequent use of the term, so I want a cup of API to drink at the bar watched.

Send bartender response is: "no such investigation wine" --404: Can not find the resource.

I met a lot of people, scientific and technological circles, but also outside of the circle. For such a common term meaning the API, there is little understanding of their constituents deviation or uncertainty. From a technical perspective, API refers to an application programming interface. Most large companies will establish application programming interface for their customers, or for internal use.

But how do you explain the API to use the vernacular term it? In addition to the meaning in the development and operations of, API is not a broader meaning of it?

First, let's take a step back, take a look at how the Internet actually works.

WWW server and remote

When I think of the Internet, my mind emerges out of a large network consisting of interconnected servers.

Each interface on the Internet are stored in a remote server in. The remote server is not so mysterious we think - but it is used to optimize the remote computer processing needs nothing more.

In order to properly understand the API, you can start the server provides a service network for the entire site (in fact, before the site was launched engineers is to develop the site through a local server) on their laptops.

When you type www.facebook.com in your browser, a request will appear on Facebook's remote server. Once your browser has received the response, it will be parsing code, showing a web page.

For browsers (which is also called a client), Facebook is a server application programming interface. This means that whenever you visit a page on the Internet, you are in a remote interaction with the server API.

API remote server is not exactly the same - it is actually part of the server, is responsible for receiving requests and sends responses.

API is a way to provide customers with services

You may have heard of the company will have API packaged products. For example, Weather Underground weather will sell its Data API access to others.

Sample scenario: you are a small business, there is a form on the company's Web site is registered to the customer for an appointment. With these you want to make an appointment details, enabling customers to automatically create an event on Google agenda.

API uses: This means that your web server needs to talk directly to the Google server, in the case of grasp given detailed information, application creation activities. After that, your server will be received in response to Google and processed, and then the information is sent back to the browser, for example, sends a confirmation message to the user.

In addition, you can usually bypass the browser's own server, send API requests directly to Google servers.

So what difference does it exist Google Calendar API to other remote server API?

From a technical point of view == == except that the form of requests and responses. In order to submit the entire page, your browser will look forward to receiving a response HTML format, which includes a display code. The Google Calendar API only returns some data - mostly the same as the JSON format.

If your web browser sends an API request after the site server becomes the client (when you use the browser to visit a website, your browser is also equivalent to a client).

== from the user's point of view, == API that allows them to leave the site without having to complete the original operation.

Most of today's website at least use some third-party API.

Problems have a third-party solutions, but in the form of libraries or services. Using existing solutions have become a more convenient and reliable.

The development team will be decomposed into their own applications can be on multiple servers communicate through the API, which is already a common practice. The server-based application server providing an additional function is commonly referred to as micro-services architecture.

To summarize, when a company to provide customers with the API, it just means that they established a set of dedicated channel URL used to return data only in response - that is, the contents of the response will not include a graphical user interface (for example websites display overhead) in.

You can send this request you to use their own browser? Usually possible. Since the actual HTTP transfers are done in the form of text, your browser may have been at their best display of the response.

For example, you can directly access the GitHub API through a browser, without the need for an access token. The following is a JSON response obtained when you visit GitHub user API path in the browser: The
Here Insert Picture Description
browser seems to be a good indication JSON response results. JSON response like this, you can be directly used in the code. From these texts, you can easily extract the data, then you can do what you want to do based on these data.

A refers to the "application" (the Application)

As the end of this, I have to give a few examples of API's it.

"Application" (Application) can refer to many things. The following is the meaning of it in the context of the API:
API:

  1. Provide a specific function of the software

  2. The entire server, the entire application or a very small part of the application

In essence, any software separated itself from the environment can become the API of "A", and probably it is itself some kind of API. So to speak, that you use in your code is third-party libraries. Once the library with your code integrated together, then the library has become a part of the overall application. As part of a special software, the library is likely to also have a API, so that it interacts with the remaining code.

Another example: In Object Oriented Design (object oriented programming), the object code is compiled. Your application may have hundreds of objects can interact.

Each object has a API-- This is a set of common methods and properties, the object may interact with other objects in the application with it.

Objects may also have private internal logic, which means that it is to avoid the external environment (so it is not that it is a API).

From the above discussion of the content of view, I hope you can grasp the generalized API, but also to understand the current common meaning of the term. Compile the group produced.

Editor: Hao Pengcheng

Original articles published 0 · won praise 0 · Views 27

Guess you like

Origin blog.csdn.net/qq_40818791/article/details/104258277