mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
@ -95,7 +95,7 @@ Also when doing requests, it's good to know that:
|
|||||||
|
|
||||||
- If you make POST, PUT, PATCH or DELETE requests, changes will be automatically and safely saved to `db.json` using [lowdb](https://github.com/typicode/lowdb).
|
- If you make POST, PUT, PATCH or DELETE requests, changes will be automatically and safely saved to `db.json` using [lowdb](https://github.com/typicode/lowdb).
|
||||||
- Your request body JSON should be object enclosed, just like the GET output. (for example `{"name": "Foobar"}`)
|
- Your request body JSON should be object enclosed, just like the GET output. (for example `{"name": "Foobar"}`)
|
||||||
- Id values are not mutable. Any `id` value in the body of your PUT or PATCH request wil be ignored. Only a value set in a POST request wil be respected, but only if not already taken.
|
- Id values are not mutable. Any `id` value in the body of your PUT or PATCH request will be ignored. Only a value set in a POST request will be respected, but only if not already taken.
|
||||||
- A POST, PUT or PATCH request should include a `Content-Type: application/json` header to use the JSON in the request body. Otherwise it will result in a 200 OK but without changes being made to the data.
|
- A POST, PUT or PATCH request should include a `Content-Type: application/json` header to use the JSON in the request body. Otherwise it will result in a 200 OK but without changes being made to the data.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
Reference in New Issue
Block a user