This implements a very basic handling of HTTP basic authentication
For this to work, the proxy will add a HTTPBasicAuthHandler with a HTTPPasswordMgrWithDefaultRealm to its opener. Whenever a server returns a 401 "Unauthorized", now urllib2 will automatically present supplied HTTP basic auth credentials.
The only thing users have to change in their code, in order to use basic authentication, is adding a parameter basic_auth=(url, user, pw) to their instantiation of odoorpc.
This implements a very basic handling of HTTP basic authentication
For this to work, the proxy will add a HTTPBasicAuthHandler with a HTTPPasswordMgrWithDefaultRealm to its opener. Whenever a server returns a 401 "Unauthorized", now urllib2 will automatically present supplied HTTP basic auth credentials.
The only thing users have to change in their code, in order to use basic authentication, is adding a parameter basic_auth=(url, user, pw) to their instantiation of odoorpc.