feat
This commit is contained in:
8
py-client/libs/http.py
Normal file
8
py-client/libs/http.py
Normal file
@@ -0,0 +1,8 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user