【发布时间】:2015-06-16 14:03:59
【问题描述】:
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
请帮忙,谢谢。
【问题讨论】:
-
你的 JSON 不完整,是这样返回的吗?
-
不,这只是一个例子。我的坏应该指定。一些 JSON 是 1000 行长 @Klaus
-
问题是你的 JSON 有问题,因为它不完整。如果您可以发布完整的 JSON 输出,那就太好了。
-
您是否使用更短且易于验证的 JSON 对其进行了测试?
-
这是您在基本身份验证中的真实密码吗?如果是这样,你应该改变它