It seems that when Navigated event occurs, the Result from the navigation of the WebView in .NET MAUI is successful, no matter that the response status is 401 for example. (Unauthorized).
I was counting that it will be Failure, for anything but 2xx. Is there a way to detect problem when loading the WebView?
(Perhaps without writing too much platform specific code)
Edit(adding some related code):
void Navigated(WebNavigatedEventArgs args)
{
if (args.Result == WebNavigationResult.Failure)
{
IsConnectionOK = false;
}
}
The Result here is success, not failure. The HTTP response status of the request is 401. (Unauthorized)