http://en.wikipedia.org/wiki/HATEOAS :
HATEOAS, an abbreviation for Hypermedia as the Engine of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures. The principle is that a client interacts with a network application entirely through hypermedia provided dynamically by application servers. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. Contrast this with e.g. a service-oriented architecture (SOA), where clients and servers interact through a fixed interface shared through documentation or an interface description language (IDL).
http://kinderman.net/2010/06/23/approaching-pure-rest-learning-to-love-hateoas :
The Twitter API, for example, has services that allow clients to update their status, or retweet one that already exists. Twitter's API is not RESTful, so the documentation for retweeting a status instructs developers to call the service by sending an HTTP POST or PUT request to http://api.twitter.com/1/statuses/retweet/[id].[format].
If the Twitter API were RESTful, clients would need to understand what it means to follow a link to retweet a status. The semantics of such a service are deeper than what Fielding talks about in his comment about browsers and crawlers.
http://code.google.com/apis/customsearch/v1/using_rest.html :
You can retrieve results for a particular search by sending an HTTP GET request to its URI. The URI for a search has the following format:
因此 Google 的自定义搜索 API 是 SOA 的一个示例,而不是 Restful。
对/错??
拜托,这是一个明确的问题。为什么有人在 12 小时后无法回答。一个清楚说明为什么不能回答的答案仍然是一个答案。
最佳答案
如果有人构建了一个硬编码 https://www.googleapis.com/customsearch/v1?parameters
URL 的客户端,那么他们就没有以 REST 方式使用该服务。如果 google 不提供可从服务条目 URL 发现的资源,其中包含此搜索 URI 的 URI 模板,则在使用此 API 时不可能完全 RESTful。
关于javascript - Google 的自定义搜索 API 是 SOA 的一个示例,不是 Restful,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6676973/