Update examples/restbucksCRUD/readme.md
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user