I recently used curl's
--data option to upload some JSON to a server, and after reading the manpage, I'm not sure whether I can have faith that it got there intact.
curl's manpage explicitly describes one difference between curl's
--data-binary options; namely, that when the
@filename syntax is used to make curl read data from a file,
--data will strip newlines from the file but
--data-binary will not.
However, the man page also makes it sound like there are more differences. The following passage from the description of
--data-binary can only be reasonably interpreted to mean that there are certain 'conversions' besides newline removal that
--data does on the data it is given:
... Data is posted in a similar manner as --data-ascii does, except that newlines and carriage returns are preserved and conversions are never done. (emphasis mine)
What are these mysterious "conversions"? Do they even exist? They are not documented in the manual's section on the
--data option, nor can I discover them through experimentation. The obvious things that one might expect the
--data option to transform (like ampersands, slashes, hashes, question marks, equals signs, Chinese characters, or grinning cat faces with smiling eyes) all get sent intact and unchanged.
So what is the manual talking about?