在internallogin
页面上,如果用户进行了身份验证,我想发出一个post请求。为此,我有以下代码。在
@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')
在打印“合法登录”之后,马上发生的是我得到了一个错误TypeError: 'Request' object is not callable
。如何使用烧瓶发出邮寄请求?在
您可以使用^{} 发布帖子,如下所示:
但是,通常不需要从服务器本身调用服务器。您应该考虑将
/internal
路由中的逻辑抽象出来,并在该路由中直接调用它。在以下是来自@Karin的回答
以下可能是您收到错误的原因。在
{a1}
这可能会解决这个问题。在
^{pr2}$相关问题 更多 >
编程相关推荐