-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,486
  • 2
  • 15
  • 28
MSL
  • 1
  • 1
  • 2
    The error tells you the exact problem. – Flimzy Jun 06 '19 at 11:50
  • 1
    Also, there's no such thing as a "fauxton database". Fauxton is just a web UI for CouchDB. And by using curl, you're not using fauxton at all. So fauxton is 100% unrelated to what you're doing. – Flimzy Jun 06 '19 at 11:57

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,486
  • 2
  • 15
  • 28