How do i send Header value with webview url?

后端 未结 2 474
萌比男神i
萌比男神i 2021-01-22 05:04

I develop and android app which has webview. I want to send header value with url. If it is possible any one help me to give the source code.

相关标签:
2条回答
  • 2021-01-22 05:36

    It is better to do that via HttpClient.

    0 讨论(0)
  • 2021-01-22 05:54
    Map<String, String> headers = new HashMap<String, String>();
    headers.put(header-key, header-value);
    mWebView.loadUrl(your url, headers);
    

    does this one helps? http://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String,%20java.util.Map)

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