Home / Function/ build_response() — requests Function Reference

build_response() — requests Function Reference

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

Function python CoreAPI VerbHandlers calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  ccc37729_feb7_52c6_708d_eea515a31776["build_response()"]
  10abb140_ad40_5285_21f7_5b6e4a140a93["RedirectSession"]
  ccc37729_feb7_52c6_708d_eea515a31776 -->|defined in| 10abb140_ad40_5285_21f7_5b6e4a140a93
  d54c8979_096f_53b2_ee13_71309e1bb559["_patch_adapter_gzipped_redirect()"]
  d54c8979_096f_53b2_ee13_71309e1bb559 -->|calls| ccc37729_feb7_52c6_708d_eea515a31776
  772251a3_91b5_d6a8_857f_bb938ed045f7["send()"]
  772251a3_91b5_d6a8_857f_bb938ed045f7 -->|calls| ccc37729_feb7_52c6_708d_eea515a31776
  2112e280_1aad_6146_ba17_10eb66ffc148["_build_raw()"]
  ccc37729_feb7_52c6_708d_eea515a31776 -->|calls| 2112e280_1aad_6146_ba17_10eb66ffc148
  style ccc37729_feb7_52c6_708d_eea515a31776 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2566–2578

    def build_response(self):
        request = self.calls[-1].args[0]
        r = requests.Response()

        try:
            r.status_code = int(self.redirects.pop(0))
        except IndexError:
            r.status_code = 200

        r.headers = CaseInsensitiveDict({"Location": "/"})
        r.raw = self._build_raw()
        r.request = request
        return r

Domain

Subdomains

Calls

Frequently Asked Questions

What does build_response() do?
build_response() is a function in the requests codebase, defined in tests/test_requests.py.
Where is build_response() defined?
build_response() is defined in tests/test_requests.py at line 2566.
What does build_response() call?
build_response() calls 1 function(s): _build_raw.
What calls build_response()?
build_response() is called by 2 function(s): _patch_adapter_gzipped_redirect, send.

Analyze Your Own Codebase

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

Try Supermodel Free