HTTP redirects

By default, HTTP redirects are not followed and only the firstresponse is shown:

  1. $ http httpbin.org/redirect/3

Follow Location

To instruct HTTPie to follow the Location header of 30x responsesand show the final response instead, use the —follow, -F option:

  1. $ http --follow httpbin.org/redirect/3

Showing intermediary redirect responses

If you additionally wish to see the intermediary requests/responses,then use the —all option as well:

  1. $ http --follow --all httpbin.org/redirect/3

Limiting maximum redirects followed

To change the default limit of maximum 30 redirects, use the—max-redirects=<limit> option:

  1. $ http --follow --all --max-redirects=5 httpbin.org/redirect/3