Ari Davidow wrote: > I am trying to request a page that is being protected by basic authentication. > > import httplib, urllib,binascii > cookie = binascii.b2a_base64("user:password") > h = httplib.HTTP("www.site.com") > h.putrequest("GET", "/admin/flushgo.html?ok=ok" "HTTP/1.0\r\n") I think you can (and should) omit that HTTP/1.0 specifier and the line ending. h.putrequest("GET", "/admin/flushgo.html?ok=ok") > h.putheader("Proxy-authorization", "Basic %s" % cookie) And here, according to the source of urllib2.py, this should be changed to: h.putheader("Authorization", "Basic %s" % cookie) Good luck, -Steve -- Steve Purcell, Pythangelist Get testing at http://pyunit.sourceforge.net/ Any opinions expressed herein are my own and not necessarily those of Yahoo
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4