Curl giving "Invalid UTF-8 JSON" error from CouchDb although JSON is fine? Any ideas? -
This question "about error 'invalid JSON' 'thought is slightly different than DB's view, but Jason's OK". : No file is trying to upload, just enter a simple document.
For example, I'm actually trying to use Oreli's book "Cochidibi: The Definition Guide" and I'm pretty sure that I tried to do it earlier and to do it Found for Here's the command:
curl -x PUT http: // username: password@127.0.0.1: 5984 / album / 6e1295ed6c29495e54cc05947f18c8af -d '{"title": "Something to lose Also do not save "," Artist ":" Foo fighters "} '
Database album is present and the username and password are correct. I have checked it with JSONLint and JSON is valid and I'm getting damaged ... Probably there is a problem with the CouchDB server but it is running properly ... any thoughts? This is driving me!
Thank you
Thanks guys get out, this is a problem to avoid quote Here I have been given the answer that I am on the Cochadi User Mailing List from David:
This is a window that is about to quote - a real panda unfortunately on the windows cmd.exe The shell does not parse it correctly. When the rules to avoid "" or "" or \ "are \" a bit unclear, but it works:
C: \ tmp> curl -x-dot-d "{\" title \ ":" 6e1295ed6c29495e54cc05947f18c8af "," rev ":" 1-4b39c2971c9ad54cb37e08fa02fc636 "\" foo fighters \ "}" {"ok": "id": "6e1295ed6c29495e54cc05947f18c8af"}
C: \ tmp>
"Basically you need \" escape \ "all \" quotation \ "inside your JSON"
This resolves my problem
< / Div>
Comments
Post a Comment