GET HTTP状态code Android中的WebView状态、HTTP、GET、WebView

2023-09-04 23:34:27 作者:月上柳梢头

我开发一个Android应用程序,它加载网站的web视图,但有时该网站收益以http code 500。

i'm developing an android app that it load a website in a webview, but sometimes the website return with Http code 500.

我的问题是....有什么办法让从web视图HTTP状态code用监听器或其他类??

My question is.... There is any way to get the http status code from a webview with a listener or with another class??

我想实现一个WebViewClient,但我无法得到它收到的WebView HTTP状态code。

I tried to implement an WebViewClient, but i couldn't get the http status code which webview received.

感谢所有。

推荐答案

这是不可能的(由于我写这​​篇的时间)。该文档的 onReceiveError()暧昧充其量不过是你看待这个问题,

It's not possible (as of the time i'm writing this). The docs for onReceiveError() are ambiguous at best, but it you look at this issue,

HTTP://$c$c.google。 COM / P /安卓/问题/详细信息?ID = 968

很明显,HTTP状态codeS将无法通过该机制的报道。它是如何有可能是开发商写了的WebView 有没有办法来检索HTTP状态code真的吹拂我的心灵。

It's clear that HTTP status codes won't be reported through that mechanism. How it's possible that the developers wrote WebView with no way to retrieve the HTTP status code really blows my mind.

 
精彩推荐