linux - 抑制详细并仅显示 curl 输出命令

标签 linux shell curl

我使用的 curl 命令如下 curl -i -X POST -H 'Content-type:application/json' some_url -d '{ "some":"json"}' 并得到输出如下。

HTTP/1.1 200 OK
Server: openresty
Date: Tue, 03 Apr 2018 14:28:38 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 3925
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.23
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000

{
    "jsonrpc": "2.0",
    "result": [{
        "hostid": "10225",
        "proxy_hostid": "0",
        "host": "sgw-2585-bus",
        "status": "0"
    }]
}

我只想要 curl 命令的 json 输出进行进一步处理。我怎样才能实现它。

注意:curl 不会像这样显示 json 输出,我已经格式化了 json block 。

最佳答案

您是否尝试过 -s 或 --silent 选项?

curl man page

关于linux - 抑制详细并仅显示 curl 输出命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49632850/

相关文章:

Linux 对从 SVN checkout 的文件的权限

php - 使用 curl 在 PHP 中获取 HTTP 代码

PHP Curl 未加载

linux - While循环性能:极慢

linux - 使用 Linux shell 脚本在字符串中的位置?

linux - 编写 shell 脚本来编译和调度我的服务器程序?

bash - 在 Bash 中比较多个文件

rest - 在Delphi XE10.1中使用/解析curl

linux - chroot jail + ssh key 被拒绝

git - 为什么 git branch 和 $(git branch) 输出不同的结果