http - curl 格式化输出
一般的, curl 输出json 是一大串,不太美观
JQ
jq常用在从json中解析出过滤出自己想要的属性值、格式化json字符串输出
安装
sudo apt-get install jq
示例:
xiao@z:$ curl http://localhost:8080/services|jq
% Total
% Received % Xferd
Average Speed
Time
Time
Time
Current
Dload
Upload
Total
Spent
Left
Speed
100
109
0
109
0
0
21800
0 --:--:-- --:--:-- --:--:-- 21800
{
"boot-product": [
{
"address": "172.23.0.1",
"port": 8081
}
],
"boot-curator": [
{
"address": "172.23.0.1",
"port": 8080
}
]
}
最后
以上就是明亮大白最近收集整理的关于http -curl 格式化输出的全部内容,更多相关http内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复