MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / http_get_text

Function http_get_text

scripts/common.py:396–399  ·  view source on GitHub ↗
(url: str, *, timeout: int = 30, headers: dict[str, str] | None = None)

Source from the content-addressed store, hash-verified

394
395
396def http_get_text(url: str, *, timeout: int = 30, headers: dict[str, str] | None = None) -> str:
397 request = urllib.request.Request(url, headers=headers or {"User-Agent": DEFAULT_USER_AGENT})
398 with urllib.request.urlopen(request, timeout=timeout) as response:
399 return response.read().decode("utf-8")
400
401
402def http_get_json(url: str, *, timeout: int = 30, headers: dict[str, str] | None = None) -> dict[str, Any]:

Callers 2

http_get_jsonFunction · 0.85
fetch_arxiv_entriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected