informations d'identification UrlFetch Python GAE
-
28-10-2019 - |
Question
Je voudrais savoir si la URL Google App Engine Fetch API Python ne prend pas en charge l'accès à des URL qui ont des informations d'identification:
http://username:password@www.domain.com/
Il devrait être une caractéristique de base, mais je ne peux pas le faire au travail et n'a pu trouver aucune documentation à ce sujet d'être pris en charge ou pas aussi bien.
La solution
SOLUTION - voici comment il devrait être fait:
result = urlfetch.fetch("http://www.domain.com/",
headers={"Authorization":
"Basic %s" % base64.b64encode("username:password")})
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow