How to send double quote in -d parameter for curl.exe? How to send double quote in -d parameter for curl.exe? windows windows

How to send double quote in -d parameter for curl.exe?


My curl.exe works with this form:

-d "{\"param\":\"value\"}"

i.e. doublequotes around data, and doublequotes masked with backslash inside


You can most certainly escape double quotes. How you do that depends on your operating system and shell, which you fail to specify. On Windows, you'd use the ^ as the escape character.

You can also do this:

curl [...] -d @filename 

...which reads post data from a file called filename.

Google and/or man is your friend.

http://curl.haxx.se/docs/manpage.html


For the escaping of double quote question, I'm finding that tripling the doublequotes works from the shell:

curl -d {"""foo""":"""bar"""}

while doubling the doublequotes works from within a batch file:

curl -d {""foo"":""bar""}

Which is quite annoying for testing in the shell first.