curl - 使用管道来处理 curl 数据

标签 curl pipe

我正在尝试将 cat 输出传递给curl:

$ cat file | curl --data '{"title":"mytitle","input":"-"}' http://api

但是input实际上是一个-

最佳答案

我花了一段时间试图解决这个问题,并让它与以下内容一起工作:

cat data.json | curl -H "Content-Type: application/json" -X POST --data-binary @- http://api

关于curl - 使用管道来处理 curl 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12583930/

相关文章:

linux - Curl 下载 ASCII 格式的 tar.gz 文件

php - 通过 PHP 和 cURL 访问 NodeJS/Socket.io

c - 使用 Pipes 和 exec() 来控制另一个控制台应用程序

linux - cPanel 服务器不正确的 URL 解析

curl - php webpayments pro install.php 不工作

http - 当请求有正文时,Go http 上下文无法捕获取消信号(curl, postman )

c# - C# 和 Delphi 之间的管道,如何让它工作?

unix - sed 是否阻塞?

linux - 如何通过管道将文件的输出传输到命令?

c++ - IPC_NOWAIT 中断连接