英文:
Android WebView - How can I see Headers?
问题
我可以看到以下代码中的一个Cookie:
String cookies = CookieManager.getInstance().getCookie(url);
但我无法弄清如何获取头信息。
英文:
I can see a cookie with the code below
String cookies = CookieManager.getInstance().getCookie(url);
but I couldn't figure out how to get headers.
答案1
得分: 1
Sure, here are the translated parts:
如果您想获取响应头部,请参考以下链接:
https://stackoverflow.com/questions/3134389/access-the-http-response-headers-in-a-webview
或者,如果您想要附加请求头部,只需在调用webView.loadUrl()时使用attach map:
https://stackoverflow.com/questions/50878560/how-to-load-url-with-headers-in-webview
英文:
Refer
if you want to get response header,
https://stackoverflow.com/questions/3134389/access-the-http-response-headers-in-a-webview
or if you want to attach request header, just use attach map when call webView.loadUrl()
https://stackoverflow.com/questions/50878560/how-to-load-url-with-headers-in-webview
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论