Android WebView – 我如何查看标头?

huangapple go评论80阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年8月3日 21:45:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/63230647.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定