读 RESTful Web Service 第一章

本文介绍了可编程Web的基本概念和技术特点,包括HTTP方法、URI、XML-RPC、SOAP等关键技术,并探讨了RESTful和RPC风格的服务架构及其区别。
[b]Chapter 1, The Programmable Web and Its Inhabitants[/b]

普通Web和可编程Web的区别:普通Web使用HTML,而可编程Web使用XML

[b]Kinds of Things on the Programmable Web[/b]
可编程Web基于HTTP和XML。有部分使用HTML、JSON、纯文本或者二进制文件,但大部分使用XML
两种区分可编程Web上的服务的方式:技术(URIs,SOAP,XML-RPC等)或底层架构和设计哲学

[b]HTTP:Documents in Envelopes[/b]
HTTP请求的主要部分:HTTP method、path、request headers、entity-body/document/representation
HTTP响应的主要部分:HTTP response code、response headers、entity-body/representation

[b]Method Information[/b]
HTTP八个方法
OPTIONS:The OPTIONS method represents a request for information about the communication options available on
the request/response chain identified by the Request-URI.
GET:The GET method means retrieve whatever information(in the form of an entity) is identified by the Request-URI.
HEAD:The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
POST:The POST method is used to request that the origin server accept the entity enclosed in the request as a new
subordinate of the resource identified by the Request-URI in the Request-Line.
PUT:The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
DELETE:The DELETE method requests that the origin server delete the resource identified by the Request-URI.
TRACE:The TRACE method is used to invoke a remote, application-layer loop-back of the request message.
CONNECT:This specification(rfc2616) reserves the method name CONNECT for use with a proxy that can dynamically switch
to being a tunnel

[b]Scoping Information[/b]
URI path

[b]The Competing Architectures[/b]
三种风格的Web服务架构
RESTful,面向资源的架构:S3、GData
RPC风格的架构:XML-RPC、SOAP
REST-RPC混合架构:del.icio.us、Flickr、大部分Web程序

所有的静态Web站点都是RESTful的

If it's on the Web, it's a web service.

[b]Technologies on the Programmable Web[/b]
HTTP,URI,XML-RPC,SOAP,WS-*,WSDL,WADL

[b]Leftover Terminology[/b]
Service-Oriented Architecture:面向服务架构
SOAP as a competitor to REST:RESTful架构最大的敌人是RPC架构,而不是特有的技术如SOAP。SOAP由于历史的偶然性与RPC架构
绑定在一起。
HTTP+POX:HTTP+Plain Old XML,代表了REST-RPC混合服务。但有时候不用XML而使用JSON,纯文本或二进制文件。重点在于在于这些
服务具有RESTful的设计,而基本架构是面向RPC的。
STREST:Service-Trampled REST,它是REST-RPC混合服务架构的另一个术语。
Hign and low REST:用于区分RESTful服务和REST-RPC混合服务,High REST指RESTful,Low REST则值RPC风格
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值