cURL POST --data-binary 使用来自 URL 的内容?

use*_*113 0 post curl

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

POST 文件中的内容:

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

有没有 curl 命令可以做

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

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

Han*_* Z. 6

您可以执行以下操作:

curl -s http://somefile.com/file | curl --data-binary @- http://somewhere.com
Run Code Online (Sandbox Code Playgroud)