GET curl call not returning JSON object

Question:

curl -D- -X GET -H "Authorization: Basic --------------------=" -H     
"Content-Type: application/json" https://jira.-----------.net/rest/api/latest/search?jql=assignee=wwilson

This returns actual correct output, but when I try to pipe a command to format it it tells me that no JSON object could be decoded.

{"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}}]}

This is what the output currently looks like (partial example, JSON is correct, but has sensitive information and -> ), but it has another 40 lines or so. Pretty print would be the goal. I tried it by piping in…

| python -m json.tool

But again it threw even though it is a valid JSON:

No JSON object could be decoded
Asked By: Ian

||

Answers:

-D- is including the headers in stdout. You should leave that off

The -D option dumps the headers to the given file.
The special filename - is stdout

Answered By: John La Rooy
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.