How to send line break with curl?

deamon picture deamon · Oct 6, 2010 · Viewed 90.8k times · Source

I've tried the following to send a line break with curl, but \n is not interpreted by curl.

curl -X PUT -d "my message\n" http://localhost:8000/hello

How can I send a line break with curl?

Answer

Szocske picture Szocske · Aug 30, 2011

Sometimes you want to provide the data to be sent verbatim.

The --data-binary option does that.