如何在grails中使用POST重定向到外部URL [英] how to redirect to an external URL using POST in grails

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

问题描述

我正在将我的网站与支付网关进行整合...我想从用户那里获取一些参数,并从我身边添加一些参数,然后将数据发送到支付网关。但问题是我只能从服务器端使用重定向使用GET而不是POST发送数据,支付网关希望数据中的数据包含敏感信息......因此,如何将数据传递到支付网关通过POST?

解决方案

您无法重定向POST请求,所有重定向都是新的GET请求,它来自规范。
$ b

顺便说一句,您可以在发送到支付网关之前在客户端添加此参数。例如通过使用ajax。或者通过制作额外的页面和表单,将其自动提交给支付网关


I am integrating my website with payment gateway...I want to take some parameters from the user and add some parameters from my side , and then send data to the payment gateway. But the problem is I can only send the data from server side using redirect using a GET but not POST, the payment gateway expects the data in the post form as data contains sensitive information...So how can I pass the data to payment gateway through POST??

解决方案

You can't redirect POST request, all redirections are new GET request, it's from specification.

Btw, you can add this parameters on client side, before sending to payment gateway. By using ajax for example. Or by making an extra page, with a form, that will be autosubmitted to payment gateway

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

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