首页 > 解决方案 > 特定浏览器中的 HTML 表单发布重定向错误

问题描述

我必须对第三方客户端执行带有某些参数的 html 表单 POST。

<FORM METHOD="POST" ACTION="https://www.thirparty.com.np/Retail/sgonHttpHandler.aspx?Action.ShoppingMall.Login.Init=Y">

  <INPUT TYPE=hidden NAME="BankId" VALUE="004">
  <INPUT TYPE=hidden NAME="MD" VALUE="P">
  <INPUT TYPE=hidden NAME="PID" VALUE="000000003154">
  <INPUT TYPE=hidden NAME="CRN" VALUE="NPR">
  <INPUT TYPE=hidden NAME="RU" VALUE="http://shop/response_post.aspx?">
  <INPUT TYPE=hidden NAME="CG" VALUE="N">
  <INPUT TYPE=hidden NAME="USER_LANG_ID" VALUE="001">
  <INPUT TYPE=hidden NAME="UserType" VALUE="1">
  <INPUT TYPE=hidden NAME="AppType" VALUE="retail">
  <INPUT TYPE=SUBMIT VALUE="PAY">
</FORM>

当将其用作独立的 html 文件时,此表单可以正常工作。但是当我们把它放在我们的应用程序中时,它在 angularJs 中。表格似乎不起作用。

独立使用时,我从服务器收到以下响应

Request URL: https://www.thirparty.com.np/Retail/sgonHttpHandler.aspx?Action.ShoppingMall.Login.Init=Y
Request Method: POST
Status Code: 200 OK

Request URL: https://www.thirparty.com.np/Retail/(S(nkqmntjneehv3kfv0yogfk55))/sgonHttpHandler.aspx?Action.ShoppingMall.Login.Init=Y
Request Method: POST
Status Code: 302 Found

Request URL: https://www.thirparty.com.np/Retail/(S(nkqmntjneehv3kfv0yogfk55))/web/L001/retail/jsp/ebpp/RetShoppingMallSignOn.aspx?RequestId=41373058
Request Method: GET
Status Code: 200 OK

第三个 url 是它应该去的地方,即登录页面。

但是当从应用程序中完成时,我们得到

Request URL: https://www.thirparty.com.np/Retail/sgonHttpHandler.aspx?Action.ShoppingMall.Login.Init=Y
Request Method: POST
Status Code: 302 Found

Request URL: https://www.thirparty.com.np/Retail/(S(b3w11s45wtji1vbdx3grrc45))/sgonHttpHandler.aspx?Action.ShoppingMall.Login.Init=Y
Request Method: GET
Status Code: 302 Found

Request URL: https://www.thirparty.com.np/Retail/(S(b3w11s45wtji1vbdx3grrc45))/web/errsetup.aspx?RequestId=50835532
Request Method: GET
Status Code: 200 OK

POST 表单的第一个响应是

302 找到

而当使用 html 表单作为独立时,它会返回

200 好

为什么会这样?第三方网站没有为安全做任何事情。所以这似乎不是由于IP没有被列入白名单造成的。

编辑

发现的一件事是,当使用独立的 html 文件时,表单是作为文档类型提交的。但是当从应用程序内部使用时,发送的表单是text

标签: angularjsredirectwar

解决方案


推荐阅读