在 Rails 中使用 POST 重定向到 [英] redirect_to using POST in rails

查看:37
本文介绍了在 Rails 中使用 POST 重定向到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

解决方案

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

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).

这篇关于在 Rails 中使用 POST 重定向到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆