You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is closed issue #410.
I still miss an option to force httpie to format body in the answer. I see two cases:
Misconfigured server. Some REST API services are misconfigured, they report JSON formatted data but with wrong type, like text/plain or text/html or anything else. I cannot do anything about that.
New content types could return JSON but until these are known by httpie, data are not formated. For example, application/dns-json
It could be useful to have an option to disable formating (to force text format); it could be useful for troubleshooting or for scripts. I have to use curl in some cases, to see 'raw' data sent by server.
Looks like this is already supported if you set the correct flags. Relevant excerpt:
--json, -j
(default) Data items from the command line are serialized as a JSON object.
The Content-Type and Accept headers are set to application/json
(if not specified).
--pretty {all,colors,format,none}
Controls output processing. The value can be "none" to not prettify
the output (default for redirected output), "all" to apply both colors
and formatting (default for terminal output), "colors", or "format".
The --json flag seems to be documented poorly, but you can see that it also explicitly sets the encoding to jsonhere.
There is closed issue #410.
I still miss an option to force httpie to format body in the answer. I see two cases:
Misconfigured server. Some REST API services are misconfigured, they report JSON formatted data but with wrong type, like text/plain or text/html or anything else. I cannot do anything about that.
New content types could return JSON but until these are known by httpie, data are not formated. For example, application/dns-json
Example of misconfigured service, it reports JSON data with context text/html
$ http 'https://www.coinotron.com/app?action=api'
The text was updated successfully, but these errors were encountered: