Add a --max-redirects option #188

tylercrompton opened this Issue Dec 20, 2013 · 2 comments

4 participants


Right now, we rely on the default max redirects set forth by Requests, which is currently 30. I think we should have an option to tinker around with this. It should be extremely easy to implement. It'd be a matter of adding about ten lines to httpie/, adding one to three and changing one or two in httpie/

Current Behavior:

$ http --follow

http: error: TooManyRedirects: Exceeded 30 redirects.

Proposed Behavior:

$ http --follow --max-redirects=31
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 261
Content-Type: application/json
Date: Fri, 20 Dec 2013 03:54:45 GMT
Server: gunicorn/0.17.4

    "args": {}, 
    "headers": {
        "Accept": "*/*", 
        "Accept-Encoding": "gzip, deflate, compress", 
        "Connection": "close", 
        "Host": "", 
        "User-Agent": "HTTPie/0.8.0-dev"
    "origin": "", 
    "url": ""
@jkbrzt jkbrzt added feature planned and removed planned labels Apr 10, 2014



I made a pull request a while ago for this.

Hoping that I can get some feedback from you both about how this compares to what you expected.


@jkbrzt jkbrzt added a commit that referenced this issue Feb 29, 2016
@jkbrzt Added --show-redirects and --max-redirects
Closes #157, #183, #188, #246
@jkbrzt jkbrzt closed this Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment