Created
March 30, 2021 18:30
-
-
Save raiever/1ec5543e3c4115510e19902e2a52f5c3 to your computer and use it in GitHub Desktop.
Get JSON response of SUNAPI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.auth import HTTPDigestAuth | |
def get_json(cgi, user, password, headers={'Accept': 'application/json'}): | |
response = requests.get(cgi, auth=HTTPDigestAuth(user, password), headers) | |
response_json = response.json() | |
return response | |
# in the case of Heatmap, if want to get key values, | |
# heatmap_response_json['HeatMap'][0].keys() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment