Created
August 21, 2008 09:25
-
-
Save Arbow/6526 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def httpAuthUrlFetch(self, url, username, password, mheaders={}): | |
import base64 | |
encoded = base64.b64encode(username + ':' + password) | |
authstr = "Basic " + encoded | |
mheaders['Authorization'] = authstr | |
return urlfetch.fetch(url, headers = mheaders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment