MCPcopy
hub / github.com/gpustack/gpustack / get_httpx_client

Method get_httpx_client

gpustack/client/generated_http_client.py:98–117  ·  view source on GitHub ↗

Get the underlying httpx.Client, constructing a new one if not previously set

(self)

Source from the content-addressed store, hash-verified

96 return self
97
98 def get_httpx_client(self) -> httpx.Client:
99 """Get the underlying httpx.Client, constructing a new one if not previously set"""
100 # ``verify_ssl=None`` historically meant "fall back to the OS trust
101 # store" (when the truststore default was injected here). Preserve
102 # that semantic so callers that bypass ClientSet do not silently
103 # downgrade to httpx's certifi-only default.
104 verify = (
105 self._verify_ssl if self._verify_ssl is not None else make_ssl_context()
106 )
107 if self._client is None:
108 self._client = httpx.Client(
109 base_url=self.versioned_url,
110 cookies=self._cookies,
111 headers=self._headers,
112 timeout=self._timeout,
113 verify=verify,
114 follow_redirects=self._follow_redirects,
115 **self._httpx_args,
116 )
117 return self._client
118
119 def __enter__(self) -> "HTTPClient":
120 """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""

Callers 15

__enter__Method · 0.95
__exit__Method · 0.95
listMethod · 0.45
watchMethod · 0.45
getMethod · 0.45
createMethod · 0.45
updateMethod · 0.45
deleteMethod · 0.45
listMethod · 0.45
watchMethod · 0.45
getMethod · 0.45
createMethod · 0.45

Calls 1

make_ssl_contextFunction · 0.90

Tested by

no test coverage detected