jkbr/httpie — pull request #184 by tylercrompton (2013-12-15 13:01:36+00:00)
Title: Solves Issue #183

I figured `httpie.client.get_responses` should be a generator. This was difficult to do since `requests.Session.resolve_redirects` needs to consume the given response. Since we are using the response as well, an error occurs stating that response has already been consumed. That is the explanation for the funky logic in lines httpie/client.py:60-72. I suppose I could have dropped a comment in the code indicate that.

I implemented in a way different than described (cURL's implementation). I implemented it so that it respected the output formatting arguments. Perhaps we can add a `--last` argument to only output the last response? That wouldn't too much work to implement.

Do we need to write any additional tests for this behavior? So far, the existing tests pass.