curl - Uploading multiple documents to couchdb giving error -


i have upload bulk document couchdb not working , giving error. try curl

curl -d '{"docs":[{"key":"baz","name":"bazzel"},{"key":"bar","name":"barry"}]}' -x post http://127.0.0.1:5984/testdb/_bulk_docs 

this error comes this

{"error":"bad_content_type","reason":"content-type must application/json"} 

this curl command simple copy+paste wiki of couchdb ideally should not giving error. there missing?

add header content-type application/json curl command. flag -h

e.g.

curl -h 'content-type: application/json' -d '{"docs":[{"key":"baz","name":"bazzel"},{"key":"bar","name":"barry"}]}' -x post http://127.0.0.1:5984/testdb/_bulk_docs


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -