python - Urllib2 Send Post data through proxy -
I have configured a proxy using the proxyholder and sent a request with some POST data:
cookiejar = cookielib.cookieJar () proxy = {'http': 'http: // some-proxy: port /'} opener = urllib2.build_opener (urllib2.ProxyHandler (proxy), urllib2.HTTPCookieProcessor ( Cookiezer) opener.addheaders = [('user-agent', 'user agent')] urllib2.install_opener (openers) url = "URL" opener. Open (url, urllib.urlencode ({"DATA1": "DATA1"})
Then I get a 405 http error (method not allowed)
auto-answer
The problem was a user-agent header ...
Sorry for the stupid question ...
Comments
Post a Comment