当我使用 flutter 的 InAppWebView 包加载页面时,我试图拦截特定的 post 请求并获取它的正文。
在 iOS 上这个解决方案使用“shouldOverrideUrlLoading”来检查所有请求,效果非常好。但在 Android 上,Android 操作系统的 navite Chrome 浏览器似乎不允许 inAppWebView 包捕获 post 请求。
此外,我可以通过使用 InAppWebView 包中的“shouldInterceptFetchRequest”获取所有请求 URL,但不能获取它们的正文,这正是我所需要的。
我遇到了同样的问题,但是通过将此标头添加到 URLRequest 我的问题得到了解决。
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}