I have a python app which pulls xml data through http. I want to run this app on Heroku. The app runs fine on Heroku if I just return "hello world" without trying to pull the xml. When I run this app locally (either by using the 'foreman' command, or just through python directly) it runs completely fine, and the "response.status" is 200, as expected. If I deploy to Heroku, it runs fine up to that point, but I get a response.status: 500 instead, and so cannot retrieve the XML data.
What might be causing this problem?
Here is the relevant function.
Edit: I have tried other URLs with the same results: I get an HTTP status 200 when run locally, but 500 when run on Heroku
def fetchBoBXml():
# Fetch XML info from BoB
conn = httplib.HTTPConnection(BOB_DOMAIN, BOB_PORT)
conn.request("GET", BOB_URL)
response = conn.getresponse()
status = response.status
if status != 200:
print "BOB response status %s" % status
raise Exception("BoB HTTP response status: %s" % status)
data = response.read()
conn.close()
return data