コード例 #1
0
def _get_json_or_raise(url, timeout=11):
    api_key = find_api_key()
    headers = {'User-Agent': _get_user_agent(),
               'Authorization': 'api-key %s' % api_key}
    resp = requests.get(url, timeout=timeout, headers=headers)
    resp.raise_for_status()
    return resp.json()
コード例 #2
0
def _get_json_or_raise(url, timeout=0.7):
    headers = {'User-Agent': _get_user_agent()}
    resp = requests.get(url, timeout=timeout, headers=headers)
    resp.raise_for_status()
    return resp.json()
コード例 #3
0
def _get_json_or_raise(url, timeout=0.7):
    headers = {'User-Agent': _get_user_agent()}
    resp = requests.get(url, timeout=timeout, headers=headers)
    resp.raise_for_status()
    return resp.json()