RESTful Web Services

2018-01-22 15:53:192942911186查看评论(0)
RESTful Web Services
RESTful Web Services

RPC-Style Architectures
An RPC-style web service accepts an envelope full of data from its client, and sends a
similar envelope back. The method and the scoping information are kept inside the
envelope, or on stickers applied to the envelope. What kind of envelope is not important
to my classification, but HTTP is a popular envelope format, since any web service
worthy of the name must use HTTP anyway. SOAP is another popular envelope format
(transmitting a SOAP document over HTTP puts the SOAP envelope inside an HTTP
envelope). Every RPC-style service defines a brand new vocabulary. Computer pro-
grams work this way as well: every time you write a program, you define functions with
different names. By contrast, all RESTful web services share a standard vocabulary of
HTTP methods. Every object in a RESTful service responds to the same basic interface.
The XML-RPC protocol for web services is the most obvious example of the RPC ar-
chitecture. XML-RPC is mostly a legacy protocol these days, but I’m going to start off
with it because it’s relatively simple and easy to explain. Example 1-11 shows a Ruby
client for an XML-RPC service that lets you look up anything with a Universal Product


特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:admin@php.cn

网页评论
最新评论