Skip to content

Commit 70ab6ab

Browse files
authored
chore: simplify curl command by using --json parameter
[skip ci]
1 parent bb991e8 commit 70ab6ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,24 @@ Generates the endpoints (or a whole app) from a mapping (SQL query -> URL)
7777

7878
1. Test that it works
7979
```console
80-
$ curl -i -H 'Content-Type: application/json' -d '{"name":"Sport","name_ru":"Спорт","slug":"sport","user_id":100}' http://localhost:3000/v1/categories
80+
$ curl -i --json '{"name":"Sport","name_ru":"Спорт","slug":"sport","user_id":100}' http://localhost:3000/v1/categories
8181
HTTP/1.1 204 No Content
8282
ETag: W/"a-bAsFyilMr4Ra1hIU5PyoyFRunpI"
8383
Date: Wed, 15 Jul 2020 18:06:33 GMT
8484
Connection: keep-alive
85+
8586
$ curl http://localhost:3000/v1/categories
8687
[{"id":1,"name":"Sport","name_ru":"Спорт","slug":"sport"}]
87-
$ curl -i -H 'Content-Type: application/json' -d '{"name":"Fauna","name_ru":"Фауна","slug":"fauna","user_id":101}' -X PUT http://localhost:3000/v1/categories/1
88+
89+
$ curl -i --json '{"name":"Fauna","name_ru":"Фауна","slug":"fauna","user_id":101}' -X PUT http://localhost:3000/v1/categories/1
8890
HTTP/1.1 204 No Content
8991
ETag: W/"a-bAsFyilMr4Ra1hIU5PyoyFRunpI"
9092
Date: Wed, 15 Jul 2020 18:06:34 GMT
9193
Connection: keep-alive
94+
9295
$ curl http://localhost:3000/v1/categories/1
9396
{"id":1,"name":"Fauna","name_ru":"Фауна","slug":"fauna"}
97+
9498
$ curl -i -X DELETE http://localhost:3000/v1/categories/1
9599
HTTP/1.1 204 No Content
96100
ETag: W/"a-bAsFyilMr4Ra1hIU5PyoyFRunpI"

0 commit comments

Comments
 (0)