CURL CouchDB Replication command
I'm running the following line in curl trying to setup couchdb replication:
curl -X POST -d '{"source":"http://user:password@siteA.com:5984/main","target":"main"}' -H 'Content-Type: application/json' http://user:password@siteB.com/_replicate
It keeps returning the following error:
{"error":"bad_request","reason":"invalid UTF-8 JSON"}
As far as I can tell the JSON seems valid. Any ideas?
I'm also using Powershell as well.
Looking at the CouchDB wiki I found this which could be useful to solve your issue. Basically under Windows you need to escape special characters or to write the JSON in a file and use that from the curl CLI.
I've had problems with curl and PowerShell before - my resolution was to call it from a batch file (the output put into a PowerShell variable)... thought it might be related to the way arguments were passed to curl being misinterpreted - I never got to the bottom of it as this worked...
maybe this could help http://huddledmasses.org/the-problem-with-calling-legacy-or-native-apps-from-powershell/
链接地址: http://www.djcxy.com/p/48602.html上一篇: 未收到卷曲PUT数据
下一篇: CURL CouchDB复制命令