Reputation: 23
I am getting any "error: bad request,invalid json" while running
curl -X PUT "http://localhost:5984/test" -d '{"valid":"json"}'
what to do for inserting document in database test through command line???
Upvotes: 0
Views: 877
Reputation: 8368
When doing a PUT
the _id
of the document should be provided in the URL. So e.g.:
curl -X PUT "http://localhost:5984/test/my-id" -d '{"valid":"json"}'
If you want Couch to generate the id, use a POST
instead.
Upvotes: 1