首页 文章

cURL POST - 使用URL内容的数据二进制文件?

提问于
浏览
0

是否可以使用URL中的内容进行Curl -data-binary POST?

来自文件的POST内容:

curl -X POST -H "Content-Type: plain/text" --data-binary "@file.txt" http://somewhere.com

是否有卷曲命令可以做到

curl -X POST -H "Content-Type: plain/text" --data-binary“http://somefile.com/file " " http://somewhere.com

假设http://somefile.com/file是二进制文本文件

1 回答

  • 3

    你可以做到以下几点:

    curl -s http://somefile.com/file | curl --data-binary @- http://somewhere.com
    

相关问题