MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / do_request

Function do_request

src/core/monitoring.py:97–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 return False, 0.0
96
97 url = f"{normalized}/api/v1/health"
98 started_at = time.perf_counter()
99
100 def do_request() -> tuple[int, str]:
101 request = urllib.request.Request(
102 url,
103 headers={"Accept": "application/json"},
104 method="GET",
105 )
106 opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
107 with opener.open(request, timeout=max(0.5, float(timeout_seconds))) as response:
108 status_code = int(getattr(response, "status", 0) or response.getcode() or 0)
109 body = response.read()
110 charset = response.headers.get_content_charset() or "utf-8"
111 return status_code, body.decode(charset, errors="replace")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected