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
Ability to filter JSON or XML #291
Comments
+1, this would be awesome |
There are some external tools for this: |
@corpix Thanks for the links; wasn't aware of them. There are pros and cons to an integrated tool. I am on the fence about this; I will leave it to the developers to close this issue if they wish. |
I'm afraid this is slightly beyond the scope of what httpie should support. $ http httpbin.org/get HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 398
Content-Type: application/json
Date: Wed, 07 Jan 2015 19:03:04 GMT
Server: gunicorn/18.0
Via: 1.1 vegur
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Connect-Time": "1",
"Connection": "close",
"Host": "httpbin.org",
"Total-Route-Time": "1",
"User-Agent": "HTTPie/0.8.0",
"Via": "1.1 vegur",
"X-Request-Id": "2b2e03a0-0449-40f1-9027-73bfe9edf31f"
},
"url": "http://httpbin.org/get"
} $ http httpbin.org/get | jq '.headers["User-Agent"]'
"HTTPie/0.8.0" And other tools exist for querying different formats. |
Here's another example of using jq; this one happens to also use httpie-unixsocket to communicate with Docker over
|
Sometimes API responses contain a lot of data.
Given an endpoint that returns JSON or XML, it would be cool to be able to do something like
and only get to see the "abc/xyz" sub-tree of the response.
The text was updated successfully, but these errors were encountered: