Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def get_projects(server,token):
url = server + "/projects"
headers2 = {'Authorization': 'Bearer ' + token}
#print("calling sherpa server '%s' ..." % url)
response = requests.get(url,headers=headers2)
json_response = json.loads(response.text)
projects = ", ".join([project['name'] for project in json_response])
print("Available projects on %s: %s" % (server, projects))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment