update
This commit is contained in:
parent
f9c6a3bfee
commit
4c7ad984d4
2 changed files with 17 additions and 1 deletions
10
README.md
10
README.md
|
|
@ -1042,9 +1042,17 @@ The above example will add a header "X-Time-Taken" with the number of seconds th
|
|||
|
||||
You may use the "xml" middleware to translate input and output from JSON to XML. This request:
|
||||
|
||||
GET /records/posts/1
|
||||
|
||||
Outputs:
|
||||
|
||||
{"id":1,"user_id":1,"category_id":1,"content":"blog started"}
|
||||
|
||||
While (note the "format" query parameter):
|
||||
|
||||
GET /records/posts/1?format=xml
|
||||
|
||||
Gives this outputs (it uses a "format" query parameter):
|
||||
Outputs:
|
||||
|
||||
<object><id>1</id><user_id>1</user_id><category_id>1</category_id><content>blog started</content></object>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
===
|
||||
GET /records/posts/1
|
||||
===
|
||||
200
|
||||
Content-Type: application/json
|
||||
Content-Length: 61
|
||||
|
||||
{"id":1,"user_id":1,"category_id":1,"content":"blog started"}
|
||||
===
|
||||
GET /records/posts/1?format=xml
|
||||
===
|
||||
200
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue