John, on windows this works:

curl -X PUT http://127.0.0.1:5984/testdb/4e2a2835b2dc1f424b0d5ef14400zzzz -H 
"Content-Type: application/json" -d "{\"Body\":\"I decided today
 that I don't like baseball. I like plankton.\"}"

{"ok":true,"id":"12345","rev":"1-c2f32db9503aab17cee83831fc66bda4"}

Regards,

Gustavo

-----Original Message-----
From: John Le Brasseur [mailto:[email protected]] 
Sent: Wednesday, January 25, 2017 1:57 PM
To: [email protected]
Subject: Escape Character: Bash Shell

Hi and sorry.
Another curl command-line escape character question.

This command is not working:

curl -X PUT
http://user:[email protected]:5984/testdb/4e2a2835b2dc1f424b0d5ef14400zzzz -H
"Content-Type: application/json" -d '{"Body":"I decided today that I don't like 
baseball. I like plankton."}'

No response or if I alter quotation marks etc.etc. I get 
{"error":"bad_request","reason":"invalid UTF-8 JSON"}


I have eliminated everything and the cause is the ' in don't.
I just don't know how to escape the ' correctly.(pun not intended)

I have actually tried every shell I can(Powershell, Bash and Windows command 
line)


John

Reply via email to