本文是RESTful Web Services: A Tutorial的笔记:
REST stands for Representational State Transfer, which is an architectural style for networked hypermedia applications, it is primarily used to build Web services that are lightweight, maintainable, and scalable. A service based on REST is called a RESTful service. REST is not dependent on any protocol, but almost every RESTful service uses HTTP as its underlying protocol.
尽管REST
本身不依赖任何协议,但是事实上RESTful
服务基本都使用HTTP
协议。
RESTful
服务本身的特性:
Every system uses resources. These resources can be pictures, video files, Web pages, business information, or anything that can be represented in a computer-based system. The purpose of a service is to provide a window to its clients so that they can access these resources. Service architects and developers want this service to be easy to implement, maintainable, extensible, and scalable. A RESTful design promises that and more. In general, RESTful services should have following properties and features, which I’ll describe in detail:
Representations
Messages
URIs
Uniform interface
Stateless
Links between resources
Caching
具体来说:
Representations
:使用JSON
或XML
;
Messages
,URIs
和Uniform interface
:使用HTTP
协议;
Stateless
:很重要,不同的request
之间不能有依赖。