I think if all command line tools outputted JSON, it would go a long way towards fixing the "ad-hoc parser problem" in scripts, and bring unixy shells around to a more PowerShell-like object-passing style. Passing plain text around is a great idea, but It's silly to restrict yourself to a single structural unit within that text (the "line"). We have better tech now.
No need to panic! You can still pipe it to gron [0] and recover useable output.<p>[0] <a href="https://github.com/TomNomNom/gron" rel="nofollow">https://github.com/TomNomNom/gron</a>
Note that this is not titled, "Curl will now format JSON". This will "Make curl display information on stdout after a completed transfer"[1].<p>[1] <a href="https://curl.haxx.se/docs/manpage.html#-w" rel="nofollow">https://curl.haxx.se/docs/manpage.html#-w</a>
I'm testing it, maybe I'm doing it wrong but I don't understand well if it's possible to show only the json output (and not both json and response body). I'm doing it with a trick:<p>curl -I -XGET -w '%{json}' <a href="https://www.google.com" rel="nofollow">https://www.google.com</a> | tail -1 | jq
It is a step in the right direction, but still far from all the goodnes of PowerShell's Invoke-WebRequest . Not sure curl can do anything about it though.