Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser WebView LoadUrl HttpStatusCode is 0 Options
Omri Suissa
Posted: Wednesday, July 19, 2023 9:30:36 AM
Rank: Member
Groups: Member

Joined: 2/18/2020
Posts: 24
From time to time (without any pattern we can understand), when using the following code, the HttpStatusCode is 0:

Quote:
var navigation = webView.LoadUrl(url);
navigation.WaitOne(10*1000);
var scode = navigation.HttpStatusCode; //THIS is 0 from time to time...


However, the website is loaded (before the 10 secs timeout), and we can access its data:
Quote:
var content = webView.EvalScript("document.documentElement.outerHTML", false). //THIS works even if the status is 0...


Since this is our website, we know that the loading time is about 500ms (not even close to 10 secs).

Any idea what could be the problem?
eo_support
Posted: Wednesday, July 19, 2023 9:59:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

Please check:

1. The return value of WaitOne. It should be true if your request has been successfully loaded. If it returns false, then HttpStatusCode will almost certainly be 0. In that case the issue is not HttpStatusCode, the issue is why the load task does not finish in 10 seconds;

2. Whether you are running the latest build. We did just fix an issue related to HttpStatusCode. So make sure you update to the latest build first;

EvalScript will work even when the document is still loading. So the fact EvalScript works does not mean anything.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.