-3

I am getting the below error when trying to query PUT command with curl : "error":"bad_request","reason":"Missing request body"

this is the query i am trying to execute to insert a new document in the database:

curl -X PUT  http://127.0.0.1:5984/mychannel_fabcar/CAR10/  '{"docs" : [ "_id": "CAR10", "colour": "white","make": "Ford", "model": "Figo","owner": "Meghna","~version": "\u0000CgMBAgA="]}'
Stephan Hogenboom
  • 1,543
  • 2
  • 17
  • 29
MSL
  • 1
  • 1

1 Answers1

2

shouldn't you also give the option -d for the body?

curl -X PUT   http://127.0.0.1:5984/mychannel_fabcar/CAR10/  -d '{"docs": [ "_id": "CAR10", "colour": "white","make": "Ford", "model":"Figo","owner": "Meghna","~version": "\u0000CgMBAgA="]}'

see this thread (uploading files) and this thread (uploading raw data) for a detailed explanantion.

Stephan Hogenboom
  • 1,543
  • 2
  • 17
  • 29