MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / _request_once

Function _request_once

src/core/system_selfcheck.py:169–184  ·  view source on GitHub ↗
(use_proxy: bool)

Source from the content-addressed store, hash-verified

167 }
168
169 def _request_once(use_proxy: bool) -> Dict[str, Any]:
170 session = _build_http_session(proxy_url if use_proxy else None)
171 started = time.perf_counter()
172 req_kwargs: Dict[str, Any] = {
173 "url": url,
174 "headers": headers or {},
175 "timeout": timeout_seconds,
176 }
177 if json_body is not None:
178 req_kwargs["json"] = json_body
179 if method.upper() == "POST":
180 resp = session.post(**req_kwargs)
181 else:
182 resp = session.get(**req_kwargs)
183 cost = int((time.perf_counter() - started) * 1000)
184 return {"status": int(resp.status_code), "elapsed_ms": cost}
185
186 if proxy_url:
187 try:

Callers 3

_probe_endpointFunction · 0.85

Calls 3

_build_http_sessionFunction · 0.85
postMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected