python - 如何在 python 中的 webob 中的 HttpRedirect 或 HttpFound 中发送 post 变量?

标签 python routes webob

当我在应用程序中进行重定向时,我想在帖子中发送一些变量。

场景是这样的

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/

相关文章:

python - 我正在使用 Pylons 并遇到 response.set_cookie 问题

python - 获取完整的原始 http 请求(包含 header 和正文)

python - 在不安装Mysql的情况下使用python连接MySQL

php - 拉拉维尔 5.3 : Routes in layout views

php - PUT 请求 Laravel 上的 MethodNotAllowedException

ruby-on-rails - Rails redirect_to 选择页面

python - 拆开两列

python - 使用 py2exe 将 python 脚本转换为 .exe 时,它​​是否更快?

python - inotify IN_CLOSE_WRITE 仅针对手动编辑的文件触发一次

python - 如何使用 WebOb 构建文件上传 POST HTTP 请求?