API与web服务 [英] API vs. Webservice

查看:134
本文介绍了API与web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是一个Web服务和API之间的区别?区别不是用来传输数据的协议吗?
谢谢。

What is the difference between a webservice and an API? Is the difference more than the protocol used to transfer data? thanks.

推荐答案

这是API(应用编程接口)是由第三方可以写code,与其他$ C $ I2C接口的手段。 Web服务是一个API,一个几乎总是工作在HTTP(虽然有些像SOAP,可以使用备用传输,如SMTP)。该 W3C官方定义提到,Web服务不一定使用HTTP,但是这是几乎总是这样和通常假设,除非另有提及。

An API (Application Programming Interface) is the means by which third parties can write code that interfaces with other code. A Web Service is a type of API, one that almost always operates over HTTP (though some, like SOAP, can use alternate transports, like SMTP). The official W3C definition mentions that Web Services don't necessarily use HTTP, but this is almost always the case and is usually assumed unless mentioned otherwise.

专为Web服务的示例,请参阅 SOAP ,的 REST XML-RPC 。另一种类型的API,一种用C语言编写的使用本地计算机上的示例,请参见 Linux内核API

For examples of web services specifically, see SOAP, REST, and XML-RPC. For an example of another type of API, one written in C for use on a local machine, see the Linux Kernel API.

由于作为协议远远,一个Web服务API几乎总是使用HTTP(因此Web部件),绝对涉及通过网络进行通信。一般的API可以使用他们希望的任何通信手段。 Linux内核API,例如,使用中断调用系统调用组成的API来从用户空间呼叫。

As far as the protocol goes, a Web service API almost always uses HTTP (hence the Web part), and definitely involves communication over a network. APIs in general can use any means of communication they wish. The Linux kernel API, for example, uses Interrupts to invoke the system calls that comprise its API for calls from user space.

这篇关于API与web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆