I'm running the following line in curl trying to setup couchdb replication:
curl -X POST -d '{"source":"http://user:[email protected]:5984/main","target":"main"}' -H 'Content-Type: application/json' http://user:[email protected]/_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.
It happend many times to me as well. PowerShell parser (who knows why) removes quotes in the json.
So it sends it to curl like '{source:http://user:[email protected]:5984/main,target:main}' You need to call it like this:
curl -X POST -d '{"""source""":"""http://user:[email protected]:5984/main""","""target""":"""main"""}' -H 'Content-Type: application/json' http://user:[email protected]/_replicate
Look at http://pscx.codeplex.com/ module. EchoArgs
might help when discovering such problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With