I am gettiing a HTTP Error 504: Gateway Time-out when I am running urllib2.urlopen and don't know how to resolve this.
I tried referencing this link: HTTP Error 504: Gateway Time-out when trying to read a reddit comments post but solution was no successful.
req = urllib2.Request(url)
req_body = {
'query:' query,
'variables': {
'product': product
}
}
response = urllib2.urlopen(req, json.dumps(req_body))
print 'opened'
I know this format is correct because I have used it in the past and it worked. I am expecting 'opened' to be printed, but I get the 504 error and the code exits.