-
-
Save jangeador/9bf1dfb9f339063775bfe082f6cc95f5 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