Skip to content

Instantly share code, notes, and snippets.

@philiptzou
Last active September 30, 2016 02:13
Show Gist options
  • Save philiptzou/e97dc111c85c35c2db8aab957f7cb03b to your computer and use it in GitHub Desktop.
Save philiptzou/e97dc111c85c35c2db8aab957f7cb03b to your computer and use it in GitHub Desktop.
"""
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