Home / Function/ get_redirect_target() — requests Function Reference

get_redirect_target() — requests Function Reference

Architecture documentation for the get_redirect_target() function in test_requests.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  b05faa36_98b6_6ce8_ee15_eea2e0931c8e["get_redirect_target()"]
  e238a047_9337_d199_c309_0e8209ef5cf4["CustomRedirectSession"]
  b05faa36_98b6_6ce8_ee15_eea2e0931c8e -->|defined in| e238a047_9337_d199_c309_0e8209ef5cf4
  35522ba6_f5bf_6605_cbd8_7f96271cd951["test_custom_redirect_mixin()"]
  35522ba6_f5bf_6605_cbd8_7f96271cd951 -->|calls| b05faa36_98b6_6ce8_ee15_eea2e0931c8e
  style b05faa36_98b6_6ce8_ee15_eea2e0931c8e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2256–2264

            def get_redirect_target(self, resp):
                # default behavior
                if resp.is_redirect:
                    return resp.headers["location"]
                # edge case - check to see if 'location' is in headers anyways
                location = resp.headers.get("location")
                if location and (location != resp.url):
                    return location
                return None

Domain

Subdomains

Frequently Asked Questions

What does get_redirect_target() do?
get_redirect_target() is a function in the requests codebase, defined in tests/test_requests.py.
Where is get_redirect_target() defined?
get_redirect_target() is defined in tests/test_requests.py at line 2256.
What calls get_redirect_target()?
get_redirect_target() is called by 1 function(s): test_custom_redirect_mixin.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free