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:
88
88
# pylint: disable=too-many-instance-attributes
89
89
90
90
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``."""
91
106
92
107
def __init__ (self , sock : SocketType , session : "Session" ) -> None :
93
108
self .socket = sock
You can’t perform that action at this time.
0 commit comments