Update examples/restbucksCRUD/readme.md

This commit is contained in:
jvelilla
2011-12-09 18:44:21 -02:00
parent 5d17b0dd29
commit 0aa3d81b22

View File

@@ -101,8 +101,8 @@ of to handle different type of request to the ORDER resource.
How to Create an order How to Create an order with POST
---------------------- --------------------------------
Here is the convention that we are using: Here is the convention that we are using:
POST is used for creation and the server determines the URI of the created resource. POST is used for creation and the server determines the URI of the created resource.
@@ -112,27 +112,49 @@ if the request POST is not SUCCESS, the server will response with
400 BAD REQUEST, the client send a bad request or 400 BAD REQUEST, the client send a bad request or
500 INTERNAL_SERVER_ERROR, when the server can deliver the request. 500 INTERNAL_SERVER_ERROR, when the server can deliver the request.
* Uri: http://localhost:8080/order POST /order HTTP/1.1
* Method: POST Host: 127.0.0.1:8080
* Note: you will get in the response the "location" of the new your order. Connection: keep-alive
* HEADERS: Content-Length: 196
Origin: chrome-extension://fhjcajmcbmldlhcimfajhfbgofnpcjmb
Content-Type: application/json
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: es-419,es;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Content-Type: application/json {
"location":"takeAway",
"items":[
{
"name":"Late",
"option":"skim",
"size":"Small",
"quantity":1
}
]
}
* Example CONTENT Response success
{ HTTP/1.1 201 Created
"location":"takeAway", Status 201 Created
"items":[ Content-Type application/json
{ Content-Length 123
"name":"Late", Location http://localhost:8080/order/1
"option":"skim", Date FRI,09 DEC 2011 20:34:20.00 GMT
"size":"Small",
"quantity":1
}
]
}
{
"id" : "1",
"location" : "takeAway",
"status" : "submitted",
"items" : [ {
"name" : "late",
"size" : "small",
"quantity" : 1,
"option" : "skim"
} ]
}
How to Read an order How to Read an order