Function
http_get_bytes
(url: str, *, timeout: int = 60, headers: dict[str, str] | None = None)
Source from the content-addressed store, hash-verified
| 404 | |
| 405 | |
| 406 | def http_get_bytes(url: str, *, timeout: int = 60, headers: dict[str, str] | None = None) -> bytes: |
| 407 | request = urllib.request.Request(url, headers=headers or {"User-Agent": DEFAULT_USER_AGENT}) |
| 408 | with urllib.request.urlopen(request, timeout=timeout) as response: |
| 409 | return response.read() |
| 410 | |
| 411 | |
| 412 | def semantic_scholar_headers() -> dict[str, str]: |
Tested by
no test coverage detected