Home / Function/ read() — requests Function Reference

read() — requests Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e661d358_be18_74b3_7f2e_30e0b47b69b3["read()"]
  7504ff45_daa4_e0a8_8c39_aa4f2fd4e19f["TestStream"]
  e661d358_be18_74b3_7f2e_30e0b47b69b3 -->|defined in| 7504ff45_daa4_e0a8_8c39_aa4f2fd4e19f
  7dd79754_94b4_282c_632b_983bc3749c06["test_DIGEST_STREAM()"]
  7dd79754_94b4_282c_632b_983bc3749c06 -->|calls| e661d358_be18_74b3_7f2e_30e0b47b69b3
  4ec824ee_a014_6c1d_d8f4_5a3c2f0f0215["test_POSTBIN_SEEKED_OBJECT_WITH_NO_ITER()"]
  4ec824ee_a014_6c1d_d8f4_5a3c2f0f0215 -->|calls| e661d358_be18_74b3_7f2e_30e0b47b69b3
  c5eae63c_cf8c_63d3_a472_2483880a618a["test_rewind_body()"]
  c5eae63c_cf8c_63d3_a472_2483880a618a -->|calls| e661d358_be18_74b3_7f2e_30e0b47b69b3
  402d8f7b_cfe1_dad0_af75_764ef70e7645["test_rewind_partially_read_body()"]
  402d8f7b_cfe1_dad0_af75_764ef70e7645 -->|calls| e661d358_be18_74b3_7f2e_30e0b47b69b3
  style e661d358_be18_74b3_7f2e_30e0b47b69b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 843–850

            def read(self, size=None):
                if size:
                    ret = self.data[self.index : self.index + size]
                    self.index += size
                else:
                    ret = self.data[self.index :]
                    self.index = self.length
                return ret

Domain

Subdomains

Frequently Asked Questions

What does read() do?
read() is a function in the requests codebase, defined in tests/test_requests.py.
Where is read() defined?
read() is defined in tests/test_requests.py at line 843.
What calls read()?
read() is called by 4 function(s): test_DIGEST_STREAM, test_POSTBIN_SEEKED_OBJECT_WITH_NO_ITER, test_rewind_body, test_rewind_partially_read_body.

Analyze Your Own Codebase

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

Try Supermodel Free