楼主: Lisrelchen
2472 8

RESTful Web Services Cookbook [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6306
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2015-8-13 10:42:08 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

RESTful Web Services Cookbook


Solutions for Improving Scalability and Simplicity



Book Description
While the REST design philosophy has captured the imagination of web and enterprise developers alike, using this approach to develop real web services is no picnic. This cookbook includes more than 100 recipes to help you take advantage of REST, HTTP, and the infrastructure of the Web. You'll learn ways to design RESTful web services for client and server applications that meet performance, scalability, reliability, and security goals, no matter what programming language and development framework you use.

Each recipe includes one or two problem statements, with easy-to-follow, step-by-step instructions for solving them, as well as examples using HTTP requests and responses, and XML, JSON, and Atom snippets. You'll also get implementation guidelines, and a discussion of the pros, cons, and trade-offs that come with each solution.
Book Details
  • Publisher:        O'Reilly Media
  • By:        Subbu Allamaraju
  • ISBN:        978-0-596-80168-7
  • Year:        2010
  • Pages:        314
  • Language:        English
  • File size:        2.2 MB
  • File format:        PDF
  • Download:        RESTful Web Services Cookbook


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:services Cookbook service Cook Rest philosophy advantage includes services develop

本帖被以下文库推荐

沙发
Lisrelchen 发表于 2015-8-13 10:51:16
Problem

You want to know what visibility means and what you can do to keep HTTP requests and responses visible.


Solution

Once you identify and design resources, use GET to get a representation of a resource, PUT to update a resource, DELETE to delete a resource, and POST to perform a variety of potentially nonidempotent and unsafe operations. Add appropriate HTTP headers to describe requests and responses.



藤椅
Lisrelchen 发表于 2015-8-13 10:52:17
Problem

You want to know common situations that may require you to keep requests and responses less visible to the protocol.


Solution

Whenever you have multiple resources that share data or whenever an operation modifies more than one resource, be prepared to trade visibility for better abstraction of information, loose coupling, network efficiency, resource granularity, or pure client convenience.



板凳
Lisrelchen 发表于 2015-8-13 10:53:13
Problem

You want to know how to manage state in RESTful web services such that you do not need to rely on in-memory sessions on servers.


Solution

Encode application state into URIs, and include those URIs into representations via links (see Chapter 5). Let clients use these URIs to interact with resources. If the state is large or cannot be transported to clients for security or privacy reasons, store the application state in a durable storage (such as a database or a filesystem), and encode a reference to that state in URIs.



报纸
Lisrelchen 发表于 2015-8-13 11:05:19
Problem

You want to know what idempotency and safety mean, and what you can do to ensure that the server’s implementation of various HTTP methods maintain these two characteristics.


Solution

While implementing GET, OPTIONS, and HEAD methods, do not cause any side effects. When a client resubmits a GET, HEAD, OPTIONS, PUT, orDELETE request, ensure that the server provides the same response except under concurrent conditions (see Chapter 10).



地板
Lisrelchen 发表于 2015-8-13 11:06:23
Problem

You want to know how to implement HTTP requests that are idempotent and/or safe.


Solution

Treat GET, OPTIONS, and HEAD as read-only operations, and send those requests whenever required.

In the case of network or software failures, resubmit GET, PUT, and DELETE requests to confirm, supplying If-Unmodified-Since and/or If-Match conditional headers (see Chapter 10).

Do not repeat POST requests, unless the client knows ahead of time (e.g., via server’s documentation) that its implementation of POST for any particular resource is idempotent.



7
Lisrelchen 发表于 2015-8-13 11:07:12
Problem

You want to know when and when not to use GET and the potential consequences of using GET inappropriately.


Solution

Use GET for safe and idempotent information retrieval.



8
Lisrelchen 发表于 2015-8-13 11:08:22
Problem

You want to know the potential applications of the POST method.


Solution

Use POST for the following:

  • To create a new resource, using the resource as a factory as described in Recipe 1.8

  • To modify one or more resources via a controller resource as described in Recipe 2.6

  • To run queries with large inputs as described in Recipe 8.3

  • To perform any unsafe or nonidempotent operation when no other HTTP method seems appropriate





9
chitchatla 发表于 2016-6-5 09:29:28
kan kan

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 17:18