[英]Unable to add HTTP headers with Android Webview
As far as I can tell, I'm doing this correctly. 据我所知,我做得正确。 However, the headers simply are not added.
但是,仅不添加标题。 Any help is appreciated.
任何帮助表示赞赏。 Here's the code:
这是代码:
Map<String, String> headers = new HashMap<String, String>();
headers.put("key", "value");
webView.loadUrl("https://www.*website*.com/index.php", headers);
I was wrong to assume the header key could be arbitrary. 我以为标头键可能是任意的是错误的。 Prefixed with an 'X-', everything works.
前缀为“ X-”,一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.