New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pretty Print JSON Body #410
Comments
@jkbrzt yes but this is not the response |
@loretoparisi it is the response body, see http://httpbin.org/get |
Ok I have found the issue, it's something wrong in the response headers. In fact if I try a well formatted response body with json format like: http --session=cookies.txt --pretty all --json --print=b --style=xcode "https://api.spotify.com/v1/tracks/0eGsygTp906u18L0Oimnem" it works. HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 1996
Content-Type: text/plain; charset=utf-8 the resulting formatting is plain. |
@jkbrzt exactly. In fact the issue was that the server headers was |
How to pretty print a JSON output body in order to format it in bash console like
My command looks like now
http --session=cookies.txt --pretty all --json --print=b --style=xcode "https://myapi.company.com | python -m json.tool
Does the option
--pretty
aims to pretty print the output body? Having it seems to not prettify the output body, instead it prints the json as plain textThe text was updated successfully, but these errors were encountered: