This commit is contained in:
Maurits van der Schee 2020-04-29 03:59:34 +02:00
commit 4c7ad984d4
2 changed files with 17 additions and 1 deletions

View file

@ -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>

View file

@ -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