MCPcopy
hub / github.com/encode/httpx / aclose

Method aclose

httpx/_models.py:1065–1076  ·  view source on GitHub ↗

Close the response and release the connection. Automatically called if the response body is read to completion.

(self)

Source from the content-addressed store, hash-verified

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
1079class Cookies(typing.MutableMapping[str, str]):

Callers 3

aiter_rawMethod · 0.95
test_aclose_on_syncFunction · 0.95

Calls 1

request_contextFunction · 0.85

Tested by 2

test_aclose_on_syncFunction · 0.76