test_chunked_upload_uses_only_specified_host_header() — requests Function Reference
Architecture documentation for the test_chunked_upload_uses_only_specified_host_header() function in test_lowlevel.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD 669b1ba9_5ecc_03aa_8881_864679be1aaf["test_chunked_upload_uses_only_specified_host_header()"] 48561d17_8bd1_bf20_5710_ec3053a534d2["test_lowlevel.py"] 669b1ba9_5ecc_03aa_8881_864679be1aaf -->|defined in| 48561d17_8bd1_bf20_5710_ec3053a534d2 style 669b1ba9_5ecc_03aa_8881_864679be1aaf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_lowlevel.py lines 63–78
def test_chunked_upload_uses_only_specified_host_header():
"""Ensure we use only the specified Host header for chunked requests."""
close_server = threading.Event()
server = Server(echo_response_handler, wait_to_close_event=close_server)
data = iter([b"a", b"b", b"c"])
custom_host = "sample-host"
with server as (host, port):
url = f"http://{host}:{port}/"
r = requests.post(url, data=data, headers={"Host": custom_host}, stream=True)
close_server.set() # release server block
expected_header = b"Host: %s\r\n" % custom_host.encode("utf-8")
assert expected_header in r.content
assert r.content.count(b"Host: ") == 1
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_chunked_upload_uses_only_specified_host_header() do?
test_chunked_upload_uses_only_specified_host_header() is a function in the requests codebase, defined in tests/test_lowlevel.py.
Where is test_chunked_upload_uses_only_specified_host_header() defined?
test_chunked_upload_uses_only_specified_host_header() is defined in tests/test_lowlevel.py at line 63.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free