I've installed couchdb and mingw64 on my windows 10, I can use futon to operate my couch db, no problem. Then I tried command line using curl. I used curl to create database named "my_database", I can query it using "GET":
$ curl -X GET http://localhost:5984/my_database/002
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 81 100 81 0 0 397 0 --:--:-- --:--:-- --:--:-- 397{"_id":"002","_rev":"1-5e653801ca3cefde8abb6492ae3bcbcd","name":"mesi","age":23}
But I cannot do any data update, seems my curl syntax had problem:
$ curl -X PUT http://127.0.0.1:5984/my_database/002/msg.jpg?res=1-5e653801ca3cefde8abb6492ae3bcbcd --data-binary @/e/msg.jpg -H "ContentType:image/jpg"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
14 910k 100 58 14 128k 58 128k 0:00:07 --:--:-- 0:00:07 125M{"error":"conflict","reason":"Document update conflict."}
I know the jpg file is there:
$ ls /e/msg.jpg
/e/msg.jpg
Why I cannot update the jpg document as attachement? I guess I might have some syntax error using curl or couchdb, but how to fix it?
Using futon_db: created document, but what's the URL resource name of it?