从银行站点回调到我在 asp.net mvc 中的操作时出现 404 错误

404 error in callback from bank site to my action in asp.net mvc

我将在线支付网关添加到使用 asp.net mvc 5 编写的网站 在我的网站需要登录。 我写了一个这样的动作:

[HttpGet]
[AllowAnonymous]
public ActionResult PaymentCallback(string au,int order_id)
{   ... }

但是当我去银行网站并完成交易时,在回调到我的网站时,它会重定向到以下地址: http://example.com/Transaction/PaymentCallback/?au=70158292914&order_id=27 iis 显示 404 错误。 但是,如果我在浏览器中单击地址栏并按回车键,那么它将转到我的操作并且路由工作正确。 为什么会发生这种情况以及如何纠正这种情况? 谢谢

我通过以下属性将我的操作类型从 get 更改为 post 解决了我的问题:

[HttpPost]