Close the response and release the connection. Automatically called if the response body is read to completion.
(self)
| 1063 | await self.aclose() |
| 1064 | |
| 1065 | async def aclose(self) -> None: |
| 1066 | """ |
| 1067 | Close the response and release the connection. |
| 1068 | Automatically called if the response body is read to completion. |
| 1069 | """ |
| 1070 | if not isinstance(self.stream, AsyncByteStream): |
| 1071 | raise RuntimeError("Attempted to call an async close on an sync stream.") |
| 1072 | |
| 1073 | if not self.is_closed: |
| 1074 | self.is_closed = True |
| 1075 | with request_context(request=self._request): |
| 1076 | await self.stream.aclose() |
| 1077 | |
| 1078 | |
| 1079 | class Cookies(typing.MutableMapping[str, str]): |