I have create an AppSynch API on AWS. I can easily query it using the console or some AWS specific package. However I would want to query it using a simple package such as e.g. urllib3. Its surprisingly hard to find anyone doing using a direct api call (everyone uses some kind of aws related packages or solutions that i cant seem to get to work). The query I want to do is:
mutation provision {
provision(
noteId:
{ec2Instance: "t2.micro",
s3Bucket: "dev"})}
I have tried with different variations of:
query = """
mutation provision {
provision(
noteId:
{ec2Instance: "t2.micro",
s3Bucket: "dev"})}
"""
headers = {"x-api-key": api_key}
http = urllib3.PoolManager()
data = json.dumps("query": query, "variables": {}, "operationName": "somename")
r = http.request('POST', url, headers=headers,
data=data.encode('utf8'))
But I somehow cannot get it to work, i keep on getting messages that the API cant understand the POST request