给定here的代码段给出了输出
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 56 0 32 100 24 461 346 --:--:-- --:--:-- --:--:-- 463
{"success": true}
但是当我直接在终端中给出相同的curl命令时,它输出为
{"success": true}
仅
那么为什么这些输出之间存在差异?我只想在这里回复{"成功":真}。我不想要其他数据。我该怎么做?
我正在使用的Curl full命令是:curl -X POST -d' {" device_id":" 181CBBE"}' http://www.example.com/get_device_details
答案 0 :(得分:1)
摘要转到stderr
,回复转到stdout
;您的popen
命令仅返回stdout
;使用curl -s
来取消摘要