【发布时间】:2016-10-17 18:53:07
【问题描述】:
我的场景是这样的:我们将用户指向一个表单,他们在其中填写数据(3DSecure)然后发布,然后网站将响应发布到回调 URL - 这个响应是我想要捕获的。 WebView.shouldInterceptRequest() 可以获取标题但不能获取内容(为什么,Google?)。我试过this link,它可以得到用户发送的POST数据。有什么方法可以使用 Javascript 将接收到的 POST 数据捕获到我选择的回调中?
我看到了this post from 5 years ago,该男子将响应发送回服务器,然后从手机中获取内容。这远非理想。肯定有更新的解决方案吗?
shouldInterceptRequest() 提到响应包含“response information or null if the WebView should load the resource itself”,我如何获取它以使 WebView 不应该加载资源本身?源代码似乎总是返回 null。
【问题讨论】:
-
Is there any way to use Javascript to catch the POST data。是的。有。在实际发布之前,您可以使用与表单输入验证几乎相同的 javascript。