2
When I try to perform the cURL request here, Windows 7 (x64) returns an output with no line breaks:
C:\Users\kiwi>curl http://www.documentcloud.org/api/search.json?q=group:nytimes
{"total":2821,"page":1,"per_page":10,"q":"group:nytimes","documents":[{"id":"862
75-isn-10015-abd-al-rahim-al-nashiri-jtf-gtmo","title":"ISN 10015 - Abd al Rahim
al Nashiri - JTF-GTMO Detainee Assessment","access":"public","pages":15,"descri
ption":null,"source":null,"created_at":"Sun, 24 Apr 2011 15:50:19 +0000","update
d_at":"Mon, 25 Apr 2011 17:11:41 +0000","canonical_url":"http://www.documentclou
d.org/documents/86275-isn-10015-abd-al-rahim-al-nashiri-jtf-gtmo.html","resource
s":{"pdf":"http://s3.documentcloud.org/documents/86275/isn-10015-abd-al-rahim-al
-nashiri-jtf-gtmo.pdf","text":"http://s3.documentcloud.org/documents/86275/isn-1
0015-abd-al-rahim-al-nashiri-jtf-gtmo.txt","thumbnail":"http://s3.documentcloud.
org/documents/86275/pages/isn-10015-abd-al-rahim-al-nashiri-jtf-gtmo-p1-thumbnai
l.gif","search":"http://www.documentcloud.org/documents/86275/search.json?q={que
ry}","page":{"text":"http://www.documentcloud.org/documents/86275/pages/isn-1001
5-abd-al-rahim-al-nashiri-jtf-gtmo-p{page}.txt","image":"http://s3.documentcloud
.org/documents/86275/pages/isn-10015-abd-al-rahim-al-nashiri-jtf-gtmo-p{page}-{s
ize}.gif"}}},{"id":"86274-isn-10020-majid-khan-jtf-gtmo-detainee-assessment","ti
tle":"ISN 10020 - Majid Khan - JTF-GTMO Detainee Assessment","access":"public","
pages":12,"description":null,"source":null,"created_at":"Sun, 24 Apr 2011 15:50:
18 +0000","updated_at":"Mon, 25 Apr 2011 17:10:01 +0000","canonical_url":"http:/
/www.documentcloud.org/documents/86274-isn-10020-majid-khan-jtf-gtmo-detainee-as
sessment.html","resources":{"pdf":"http://s3.documentcloud.org/documents/86274/i
sn-10020-majid-khan-jtf-gtmo-detainee-assessment.pdf" ...
This may be the default behaviour, but is there anything I can do to get some readable JSON output when using cURL on Windows?
I’ll definitely keep this in mind. It is probably possible to rework it to format JSON output from cURL inside the terminal, but that is most likely outside my own current ability. I’ll see what other users may know. But nevertheless, even outside the scope of the question, as someone who focuses his programming on Python, this is very valuable. – Kiwi – 2011-04-25T19:08:16.590
The terminal won't help you. You need a program to format it. I don't think curl does formatting, either. On a posix platform this would usually be done with tools in a pipeline. – Keith – 2011-04-25T19:25:45.563