curl -D- -X GET -H "Authorization: Basic --------------------=" -H
"Content-Type: application/json" https://jira.-----------.net/rest/api/latest/search?jql=assignee=wwilson
这会返回实际正确的输出,但是当我尝试管道命令来格式化它时,它告诉我没有JSON对象可以被解码。
{"expand":"names,schema","startAt":0,"maxResults":50,"total":1,"issues":
[{"expand":"editmeta,renderedFields,transitions,changelog,operations","id":"11497"
,"self":"https://jira.some-company.net/rest/api/latest/issue/11497","key":"QA-
121","fields":{"summary":"Test_Run","progress":
.... Not going to give you the crapton of lines in the middle ....
{"progress":0,"total":0},"lastViewed":"2015-06-16T09:52:41.616-
0400","components":
[],"timeoriginalestimate":null,"aggregatetimespent":null}}]}
这是输出目前的样子(部分示例,JSON是正确的,但有敏感信息和 - >),但它有另外40行左右。漂亮的印刷品将成为目标。我试着通过管道......
| python -m json.tool
但即使它是一个有效的json,它又扔了......
No JSON object could be decoded
请帮助,谢谢。
答案 0 :(得分:4)
-D-
包含stdout中的标头。你应该把它关掉
-D
选项将标头转储到给定文件
特殊文件名-
是stdout