Skip to content

Commit 4c7ad98

Browse files
committed
update
1 parent f9c6a3b commit 4c7ad98

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,17 @@ The above example will add a header "X-Time-Taken" with the number of seconds th
10421042

10431043
You may use the "xml" middleware to translate input and output from JSON to XML. This request:
10441044

1045+
GET /records/posts/1
1046+
1047+
Outputs:
1048+
1049+
{"id":1,"user_id":1,"category_id":1,"content":"blog started"}
1050+
1051+
While (note the "format" query parameter):
1052+
10451053
GET /records/posts/1?format=xml
10461054

1047-
Gives this outputs (it uses a "format" query parameter):
1055+
Outputs:
10481056

10491057
<object><id>1</id><user_id>1</user_id><category_id>1</category_id><content>blog started</content></object>
10501058

tests/functional/001_records/087_read_and_write_posts_as_xml.log

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
===
2+
GET /records/posts/1
3+
===
4+
200
5+
Content-Type: application/json
6+
Content-Length: 61
7+
8+
{"id":1,"user_id":1,"category_id":1,"content":"blog started"}
9+
===
210
GET /records/posts/1?format=xml
311
===
412
200

0 commit comments

Comments
 (0)