将cURL响应重定向到发布的cURL,但不通过文件

问题描述 投票:-1回答:1

我想将一个json对象从一个url(json)直接发布到另一个url

所以命令如下:

curl "<resource_link>.json" -o sample.json
curl -X POST "<my_link>" "Content-type: application/json" -d @sample.json

我想避免这种情况,那么解决方案是什么?是这样吗?

curl -X POST "<my_link>" "Content-type: application/json" -d "curl <resource_link>.json" 

但是它不起作用吗?另外,这一篇文章Stream cURL response to another cURL command posting the result无法彻底解释,并且无法正常工作是的,

卷曲

手册说明了'@',但没有说明有关使用其他curl或者,如果我可以将第一个cURL响应临时保存在某个地方,然后在其他命令中使用它(但不能在文件中使用)

bash curl request response response.redirect
1个回答
0
投票
  1. 不想
© www.soinside.com 2019 - 2024. All rights reserved.