HTTP - basic authentication example.

John J. Lee jjl at pobox.com
Sun Sep 19 22:11:54 CEST 2004


jjl at pobox.com (John J. Lee) writes:
[...]
> Assuming Python 2.4 (UNTESTED -- I haven't recently had occasion to
> use any auth.):
> 
> import urllib2
> import cookielib
> import ClientCookie  # for some more urllib2 handlers, for good measure ;-)
> 
> def build_opener(realm, uri, user, password):
>     ch = cookielib.HTTPCookieProcessor()
[...]

Whoops, HTTPCookieProcessor is actually in urllib2, not cookielib.


John



More information about the Python-list mailing list