Hacker News new | ask | show | jobs
by zimpenfish 3181 days ago
> Pretty much PostMan (that a lot of ppl use for no reason)

I can't see anywhere in the httpie docs about capturing variables from and/or running tests on the HTTP responses - it's an extremely powerful feature of Postman when you're debugging non-trivial HTTP flows.

1 comments

and nor should it. If you think the unix way and use a tool that excels in that you'll find your path to success (e.g. jq).

    $ userId=$(http get https://jsonplaceholder.typicode.com/posts/1 | jq '.userId')
    $ http get "https://jsonplaceholder.typicode.com/users/$userId" | jq '{name,email}'
    {
      "name": "Leanne Graham",
      "email": "Sincere@april.biz"
    }