Skip to content

Instantly share code, notes, and snippets.

@ZaninAndrea
Created April 4, 2022 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZaninAndrea/e8c52de5e13041ff81636b07aec885cc to your computer and use it in GitHub Desktop.
Save ZaninAndrea/e8c52de5e13041ff81636b07aec885cc to your computer and use it in GitHub Desktop.
Sending a request to Igloo
import requests
import json
# Converts a python dictionary into a JSON string
payload = json.dumps({"query": """{
user{
email
}
}"""})
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer your-token-here"
}
response = requests.request(
"POST",
"https://v1.igloo.ooo/graphql",
data=payload,
headers=headers
)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment