From 73e36315e81376b717034673978fc05d1e3ef463 Mon Sep 17 00:00:00 2001 From: Alberto Casero Date: Fri, 27 Nov 2015 00:36:41 +0100 Subject: [PATCH] Update README.md Doc updated after the single object POST response format change. --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7877985..a53db7e 100644 --- a/README.md +++ b/README.md @@ -48,21 +48,19 @@ Making a POST to the resource that we want (fighters in this case) with the `"Co curl -H "Content-Type: application/json" -X POST -d '{"name": "Chuck Norris", "style": "Karate"}' http://localhost:8000/api/fighters ``` -And it returns a JSON array with a JSON object with an ID autogenerated: +And it returns a JSON object with an ID autogenerated: ```json -[ - { - "style":"Karate", - "name":"Chuck Norris", - "id":1 - } -] +{ + "style":"Karate", + "name":"Chuck Norris", + "id":1 +} ``` This will create a `db` folder in your working directory and a `fighters` directory inside with a file called `1`. -We can also insert fighters in bulk by using a JSON array: +We can also **bulk insert** a bunch of fighters by using a JSON array: ```bash curl -H "Content-Type: application/json" -X POST -d '[{"name": "Bruce Lee", "style": "Kung Fu"}, {"name": "Rocky Balboa", "style": "Boxing"}]' http://localhost:8000/api/fighters