File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,21 @@ class Response:
8888 # pylint: disable=too-many-instance-attributes
8989
9090 encoding = None
91+ socket : SocketType
92+ """The underlying socket object (CircuitPython extension, not in standard requests)
93+
94+ Under the following circumstances, calling code may directly access the underlying
95+ socket object:
96+
97+ * The request was made with ``stream=True``
98+ * The request headers included ``{'connection': 'close'}``
99+ * No methods or properties on the Response object that access the response content
100+ may be used
101+
102+ Methods and properties that access response headers may be accessed.
103+
104+ It is still necessary to ``close`` the response object for correct management of
105+ sockets, including doing so implicitly via ``with requests.get(...) as response``."""
91106
92107 def __init__ (self , sock : SocketType , session : "Session" ) -> None :
93108 self .socket = sock
You can’t perform that action at this time.
0 commit comments