以下是我的 curl 命令:
curl -d "$(curl localhost:8080/fetchStrs)" localhost:8080/uppercase,toChars -H "Content-Type: application/json"
我期望得到回报:
["T","E","S","T","1","T","E","S","T","2"]
但我得到的却是:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17 100 17 0 0 5666 0 --:--:-- --:--:-- --:--:-- 5666
["T","E","S","T","1","T","E","S","T","2"]
为什么 curl 认为我正在下载某些内容?如何删除下载元数据?
答案1
没关系,这是一个简单的修复:
curl -d "$(curl -s localhost:8080/fetchStrs)" localhost:8080/uppercase,toChars -H "Content-Type: application/json"
-s
会默默地去做。