def get_response(self, url, username=None, password=None):
scheme, netloc, path, query, frag = urlparse.urlsplit(url)<EOL>req = self.get_request(url)<EOL>stored_username, stored_password = self.passman.find_user_password(None, netloc)<EOL>if stored_username is None:<EOL><INDENT>if username is None and self.prompting:<EOL><INDENT>username = urllib.quote(raw_input('<STR_LIT>' % netloc))<EOL>password = urllib.quote(getpass.getpass('<STR_LIT>'))<EOL><DEDENT>if username and password:<EOL><INDENT>self.passman.add_password(None, netloc, username, password)<EOL><DEDENT>stored_username, stored_password = self.passman.find_user_password(None, netloc)<EOL><DEDENT>authhandler = urllib2.HTTPBasicAuthHandler(self.passman)<EOL>opener = urllib2.build_opener(authhandler)<EOL>return opener.open(req)<EOL>
does the dirty work of actually getting the rsponse object using urllib2
and its HTTP auth builtins.