Last active
September 30, 2016 02:13
-
-
Save philiptzou/e97dc111c85c35c2db8aab957f7cb03b to your computer and use it in GitHub Desktop.
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
""" | |
A simple script to initial a request to Sierra GraphQL service and | |
then print out current HIVDB version. | |
""" | |
from __future__ import print_function | |
import json | |
import requests | |
resp = requests.post( | |
'https://hivdb.stanford.edu/graphql', | |
data=json.dumps({ | |
'query': 'query { viewer { currentVersion { text } } }', | |
'variables': {} | |
}), | |
headers={ | |
'Content-Type': 'application/json' | |
} | |
) | |
print('Current HIVDB Version:', | |
resp.json()['data']['viewer']['currentVersion']['text']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment