【问题标题】:How to return Http error response from webViewClient.shouldInterceptRequest()?如何从 webViewClient.shouldInterceptRequest() 返回 Http 错误响应?
【发布时间】:2014-01-09 15:06:52
【问题描述】:

我已经覆盖了public WebResourceResponse shouldInterceptRequest(WebView webView, String url),它应该根据Ajax 函数的请求返回自定义响应。但看起来 WebResourceResponse 只包含响应正文。如何传递这样的 HTTP 响应:

HTTP/1.1 202
Cache-Control: no-cache
Custom-param: param

给我的WebView

【问题讨论】:

    标签: android ajax webview http-headers webviewclient


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-30
      • 1970-01-01
      • 1970-01-01
      • 2019-08-25
      • 2018-02-13
      • 2018-04-23
      • 2019-05-26
      • 1970-01-01
      相关资源
      最近更新 更多