test_manual_redirect_with_partial_body_read() — requests Function Reference
Architecture documentation for the test_manual_redirect_with_partial_body_read() function in test_requests.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD 8b9e881e_59b3_b0fe_3839_fc5ec67a1ba7["test_manual_redirect_with_partial_body_read()"] 22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"] 8b9e881e_59b3_b0fe_3839_fc5ec67a1ba7 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14 style 8b9e881e_59b3_b0fe_3839_fc5ec67a1ba7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_requests.py lines 1949–1966
def test_manual_redirect_with_partial_body_read(self, httpbin):
s = requests.Session()
r1 = s.get(httpbin("redirect/2"), allow_redirects=False, stream=True)
assert r1.is_redirect
rg = s.resolve_redirects(r1, r1.request, stream=True)
# read only the first eight bytes of the response body,
# then follow the redirect
r1.iter_content(8)
r2 = next(rg)
assert r2.is_redirect
# read all of the response via iter_content,
# then follow the redirect
for _ in r2.iter_content():
pass
r3 = next(rg)
assert not r3.is_redirect
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_manual_redirect_with_partial_body_read() do?
test_manual_redirect_with_partial_body_read() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_manual_redirect_with_partial_body_read() defined?
test_manual_redirect_with_partial_body_read() is defined in tests/test_requests.py at line 1949.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free