Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Doc updated after the single object POST response format change.
  • Loading branch information
kasappeal committed Nov 26, 2015
1 parent 3453540 commit 73e3631
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73e3631

Please sign in to comment.