当我在应用程序中进行重定向时,我想在帖子中发送一些变量。
场景是这样的
def redirect_with_post():
post_variable = "i am a post variable"
return HttpRedirect(location="/confirm?id=23&user=user1")
# 现在我想发送
后变量
- 我想在重定向时在 post 中发送变量而不是查询字符串作为 post 请求。
使用的工具和软件:-
- python、webob、路线
最佳答案
重定向由客户端(您的浏览器)执行。而且它只支持单个 Location header 。您无法通过重定向发送 POST 数据。请参阅https://en.wikipedia.org/wiki/HTTP_302
关于python - 如何在 python 中的 webob 中的 HttpRedirect 或 HttpFound 中发送 post 变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14729176/