Files
big-qmt/py-client/libs/http.py
2026-08-28 18:52:27 +08:00

9 lines
296 B
Python

import json
from urllib.request import Request, urlopen
def get_json(url: str, timeout: float = 5.0):
request = Request(url, headers={"Accept": "application/json", "User-Agent": "big-qmt-python/1"})
with urlopen(request, timeout=timeout) as response:
return json.load(response)