在 rails 中使用 POST 重定向

问题描述:

是否可以使用 POST 方法重定向?
还是应该始终使用 GET 进行重定向?

Is it possible to redirect using a POST method ?
Or should redirects always be made using GET ?

用于电子商务网站订购流程的最后步骤,将数据发送到支付处理器,而不为用户引入额外的步骤.

The use for this is in the final steps of an order process for an e-commerce site, to send the data to the payment processor, without introducing an extra step for the user.

POST 请求无法重定向 - 它是 HTTP/1.1 协议的一部分.

Redirection isn't possible with POST requests - it's part of the HTTP/1.1 protocol.

您可以引入另一个步骤,其中包含要发布到支付处理器的表单数据,或者您可以从您的应用程序发送帖子(我在使用 PROTX 时所做的).

You could either introduce another step that contains the form data to be POSTed to the payment processor, or you could send the post from your application (something I have done when working with PROTX).