How to send line break with curl?

前端 未结 9 1040
深忆病人
深忆病人 2020-11-27 15:21

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:         


        
9条回答
  •  时光说笑
    2020-11-27 15:51

    The solution for someone who doesn't want to use files, and doesn't want to resort to shell escaping magic is:

    curl -X POST --data-binary @- http://url.com <

    But this is literal newlines in the post data payload, and not in form fields.

提交回复
热议问题