+ 1

Why request.authorization returns None everytime?

From flask import Flask, request app = Flask(__name__) @app.route('/login') def login(): auth = request.authorization if auth and auth.username = 'abc': return "logged in" else: return "false"

18th Mar 2020, 11:21 AM
Hassan Bari Raza
Hassan Bari Raza - avatar
4 odpowiedzi
0
Can you show me an example?
25th Mar 2020, 4:51 PM
Hassan Bari Raza
Hassan Bari Raza - avatar
0
try: if request.method == "abc":
26th Apr 2020, 7:59 PM
Safwan Faraj
Safwan Faraj - avatar
0
From flask import Flask, request app = Flask(__name__) @app.route('/login') def login(): if request.method = 'abc': return "logged in" else: return "false"
26th Apr 2020, 8:02 PM
Safwan Faraj
Safwan Faraj - avatar