应用程序接口API
Contents
在实习过程中,经常会听见 API接口开发 之类的字眼。所以一直有两个问题:
- 什么是API?
- 如何做API开发?
Application Programming Interface(API)
从英文字面意思来看,API就是应用程序接口。
举一个常见的例子:在京东上下单付款之后,商家选用顺丰发货,然后你就可以在京东上实时查看当前的物流信息。京东和顺丰作为两家独立的公司,为什么会在京东上实时看到顺丰的快递信息,这就要用到API,当查看自己的快递信息时,京东利用顺丰提供的API接口,可以实时调取信息呈现在自己的网站上。除此,你也可以在快递100上输入订单号查取到快递信息。只要有合作,或是有允许,别的公司都可以通过顺丰提供的API接口调取到快递信息。既然有多方调用,那提供一个统一的调用规范会方便很多。
维基百科定义
An application programming interface (API) is a computing interface that defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. It can also provide extension mechanisms so that users can extend existing functionality in various ways and to varying degrees.
百度百科定义
API是一些预先定义的接口(如函数、HTTP接口),或指软件系统不同组成部分衔接的约定。 用来提供应用程序与开发人员基于某软件或硬件得以访问的一组例程,而又无需访问源码,或理解内部工作机制的细节。
如何做API开发?
参考第3个资料