如何从webViewClient.shouldInterceptRequest()返回Http错误响应?

bir*_*rdy 5 ajax android webview http-headers webviewclient

我已经重写public WebResourceResponse shouldInterceptRequest(WebView webView, String url),它应该根据Ajax功能的请求返回自定义响应。但是看起来WebResourceResponse只包含响应体。我如何传递像这样的HTTP响应:

HTTP/1.1 202
Cache-Control: no-cache
Custom-param: param
Run Code Online (Sandbox Code Playgroud)

给我WebView