How do I include special characters like @ and & in the cURL POST data? I’m trying to pass a name and password like:
curl -d name=john passwd=@31&3*J https://www.mysite.com
This would cause problems as @ is used for loading files and & for specifying more than one key/value. Is there some way I can escape these characters? \@ and \& don’t seem to work.
cURL > 7.18.0 has an option
--data-urlencodewhich solves this problem. Using this, I can simply send a POST request asSummarizing the comments, in case of mixed "good" and "bad" data and exclamation marks inside we can use on Windows: