Is it possible to set custom HTTP headers in the WebView

前端 未结 1 1526
囚心锁ツ
囚心锁ツ 2021-01-11 12:05

I have to access a web page from within my application and, in order to have access to it, I need to set some custom HTTP headers. I want to use the WebViewclas

相关标签:
1条回答
  • 2021-01-11 12:10

    use public void loadUrl (String url, Map extraHeaders) Since: API Level 8

    Load the given url with the extra headers. Parameters url The url of the resource to load. extraHeaders The extra headers sent with this url. This should not include the common headers like "user-agent". If it does, it will be replaced by the intrinsic value of the WebView.

    0 讨论(0)
提交回复
热议问题