Search code examples
windowscurl

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


How can I send a double quote char using curl.exe in the -d parameter. I don't want to URL encode the double quote. Since the -d data needs to be surrounded in double quotes, I cannot seem to get it to work.

Or is there another flag for curl.exe that tells it to use a files contents for the whole form post data?


Solution

  • 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