Advanced Rails - Building Industrial-Strength Web Apps in Record Time
185 Chapter 7 CHAPTER 7 REST, Resources, and Web Services 7 There are only two hard things in Computer Science: cache invalidati ...
186 | Chapter 7: REST, Resources, and Web Services Stateless The server may not hold persistent state about its sessions with th ...
What Is REST? | 187 Fielding’s thesis is very general; it actually applies to any “network-based architec- ture.” However, REST ...
188 | Chapter 7: REST, Resources, and Web Services HTT Pdefines a handful of methods; the set can be expanded by protocols such ...
What Is REST? | 189 PUT ThePUTmethod updates a resource with the representation provided in the body of thePUTrequest. If the re ...
190 | Chapter 7: REST, Resources, and Web Services DELETE As its name implies, theDELETEmethod deletes the resource identified b ...
What Is REST? | 191 Implicit in this definition of resources is that resources have state as well (a resource could have empty s ...
192 | Chapter 7: REST, Resources, and Web Services return, but cannot interpret. The concept of URIs as opaque values originates ...
What Is REST? | 193 Representations and Content Types Resources on the Web “live” and hold their state at the server, but they a ...
194 | Chapter 7: REST, Resources, and Web Services <body id="order-124"> <h1>Order #124</h1> <p>Items:&l ...
What Is REST? | 195 accept, in decreasing order of priority. Under content negotiation on the preceding service, this request wo ...
196 | Chapter 7: REST, Resources, and Web Services REST maintains that all application state should be kept on the client. This ...
What Is REST? | 197 From an HTT Pperspective, it would seem rather odd that another mechanism would have to be introduced for au ...
198 | Chapter 7: REST, Resources, and Web Services However, iteliminates the possibility of high availability (sessions cannot b ...
What Is REST? | 199 # Remove specified item from cart session[:cart].delete product_id.to_i end def empty session[:cart] = Cart. ...
200 | Chapter 7: REST, Resources, and Web Services Note that our old code has no action for “create cart,” but the new code requ ...
What Is REST? | 201 DELETE /carts/4) are traditionally routed through the same controller. The third type, line items, will be r ...
202 | Chapter 7: REST, Resources, and Web Services Let’s examine the routes that make this work: config/routes.rb map.resources ...
What Is REST? | 203 end end TheCartsControllerhandles the “create a cart” (POST /carts) and “empty cart” (DELETE /carts/:id) act ...
204 | Chapter 7: REST, Resources, and Web Services The precedingupdatemethod illustrates a difference between REST in theory and ...
«
6
7
8
9
10
11
12
13
14
15
»
Free download pdf