Python3 using requests to grab HTTP Auth Data

Νίκος Βέργος me.on.nzt at gmail.com
Wed Feb 1 10:10:39 EST 2017


# Give user the file requested
url = "http://superhost.gr/data/files/%s" % realfile
 
user, password = 'user', 'passwd'
 
r = requests.get( url, auth = (user, password) ) # send auth unconditionally
r.raise_for_status()
==========================

How can i ASK the user for http auth data and store them isntead of giving them to the script?



More information about the Python-list mailing list