On the page internallogin
, if the user authenticates, I'd like to make a post request. To that effect, I have the following code.
@app.route('/internallogin', methods=['POST', "GET"])
def showInternallogin():
uname = request.form.get("name")
passw = request.form.get("pass")
if is_valid_login(uname, passw):
print("legal_login")
req = requests.Request(method="POST", url='http://localhost:5000/internal', data={"name": uname, "passw": passw})
return req
else:
return redirect('/login')
What happtens is immidiately after printing "legal_login" is that I get the error that TypeError: 'Request' object is not callable
. How can I make a post request using flask?