MCPcopy Create free account
hub / github.com/Tong89/smartNode / _http_get

Function _http_get

backend/physics/tle_source.py:310–317  ·  view source on GitHub ↗

执行 HTTP GET 请求,返回响应文本。

(url: str, timeout: int = 15)

Source from the content-addressed store, hash-verified

308
309
310def _http_get(url: str, timeout: int = 15) -> str:
311 """执行 HTTP GET 请求,返回响应文本。"""
312 req = urllib.request.Request(
313 url,
314 headers={"User-Agent": "SmartNode-TLE-Importer/1.0 (satellite simulation)"},
315 )
316 with urllib.request.urlopen(req, timeout=timeout) as resp:
317 return resp.read().decode("utf-8", errors="replace")
318
319
320# ---------------------------------------------------------------------------

Callers 2

fetch_groupFunction · 0.85
fetch_by_catnrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected