Skip to content

Instantly share code, notes, and snippets.

@Arbow
Created August 21, 2008 09:25
Show Gist options
  • Save Arbow/6526 to your computer and use it in GitHub Desktop.
Save Arbow/6526 to your computer and use it in GitHub Desktop.
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