0

I'm using the Python library Requests to write an API wrapper for my company's server software. I'm writing a test script using Python 2.7 on Windows 7 64. We use a proxy to connect to my work network, we'll call the IP x.x.x.x:8080. My script is as follows:

import requests

ssHost = 'localhost'
ssPort = 3700
aci_Action = 'GetStatus'

aci_params = {'Action':aci_Action}
aci_RequestUrl = 'http://' + ssHost + ':' + str(ssPort)

aci_response = requests.get(aci_RequestUrl, params=aci_params)

print(aci_response.text)

This is supposed to send a GET request to http://localhost:3700/Action=GetStatus and it works fine when I'm on my work network. However, when I get home and I am not using a proxy to connect, I get the following when I run the script:

ConnectionError: HTTPConnectionPool(host='x.x.x.x', port=8080): Max retries exceeded with url: http://localhost:3700/?Action=GetStatus (Caused by : [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)

I'm sure I've turned off the proxy using the settings in Internet Explorer but I'm still getting this error. The thing is, the proxy address that the error displays is an old one that I don't use anymore. I'm trying to figure out where this proxy is set. There are things going on here that I don't understand and if anyone can point me in the right direction as far as troubleshooting I would be grateful. Thanks!

4

1 回答 1

1

Double-check the proxy settings in the Internet Options, and also check if an environment variable http_proxy exists.

于 2013-03-30T23:11:07.227 回答