如何使用WebView和POST请求获得AJAX响应?

时间:2019-07-27 08:43:13

标签: java android ajax post webview

我需要拦截获得Webview的Ajax响应

我尝试覆盖方法shouldInterceptRequest,但请求未保存输入数据。

我也尝试使用https://github.com/KonstantinSchubert/request_data_webviewclient库,但是getAjaxData()方法返回null。

我也想说我无权访问网站的前端或后端

mWebView.setWebViewClient(new WriteHandlingWebViewClient(mWebView) {
            @Override
            public WebResourceResponse shouldInterceptRequest(WebView view,
                    WriteHandlingWebResourceRequest request) {
                if(request.getUrl().toString().contains("https://audioknigi.club/ajax/mbid/")){
                    String s = request.getAjaxData();
                    ///
                }
                return super.shouldInterceptRequest(view, request);
            }
        });

0 个答案:

没有答案
相关问题