在 Pylons 中重定向请求而不丢失表单数据的首选方法是什么?

发布于 2024-07-06 14:17:33 字数 118 浏览 6 评论 0原文

我正在尝试重定向/转发 Pylons 请求。 使用redirect_to 的问题是表单数据被丢弃。 我需要保持 POST 表单数据以及所有请求标头完好无损。

有没有一种简单的方法可以做到这一点?

I'm trying to redirect/forward a Pylons request. The problem with using redirect_to is that form data gets dropped. I need to keep the POST form data intact as well as all request headers.

Is there a simple way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最终幸福 2024-07-13 14:17:33

从 POST 接收数据取决于发送数据的 Web 浏览器。 当 Web 浏览器收到重定向时,它不会重新发送该数据。 一种解决方案是对要保留的数据进行 URL 编码,并将其与 GET 一起使用。 在最坏的情况下,您始终可以将要保留的数据添加到会话中并以这种方式传递。

Receiving data from a POST depends on the web browser sending data along. When the web browser receives a redirect, it does not resend that data along. One solution would be to URL encode the data you want to keep and use that with a GET. In the worst case, you could always add the data you want to keep to the session and pass it that way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文