I would like to make a post request sending a username and password to a page named showInternal; I currently accomplish this via:
username = "johnsmith"
password = "password1234"
return redirect(url_for('showInternal', username=username, password=password))
for the redirect and
@app.route('/internal', methods=['GET'])
@login_required
def showInternal():
return render_template('internal.html')
for the destination page. This sorta works in the sense that it takes me to /internal?password=password1234&username=johnsmith
.
However, I don't want to show the user's username and password in the url. I've tried replacing the phrase methods=['GET']
with methods=['POST']
but then I get an error about that method not being allowed, and the data stays in the url anyhow.
How can I pass these data without it showing up in the url?