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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -