Created
April 4, 2022 08:37
-
-
Save ZaninAndrea/e8c52de5e13041ff81636b07aec885cc to your computer and use it in GitHub Desktop.
Sending a request to Igloo
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 | |
import json | |
# Converts a python dictionary into a JSON string | |
payload = json.dumps({"query": """{ | |
user{ | |
} | |
}"""}) | |
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