def add_username_and_pass_to_url(url, username, passwd): urlparts = list(requests.packages.urllib3.util.url.parse_url(url)) passwd = urllib_quote(passwd, '') urlparts[1] = username + ':' + passwd return unparse_url(urlparts)
def add_username_and_pass_to_url(url, username, passwd): urlparts = list(requests.packages.urllib3.util.url.parse_url(url)) passwd = urllib_quote(passwd, '') urlparts[1] = username + ':' + passwd return unparse_url(urlparts)