Skip to content

WebViewNavigationCompletedEventArgs.HttpStatusCode

property · WebViewNavigationCompletedEventArgs · cAlgo.API

DesktopCLICloud

Response HTTP status code.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (WebView.NavigationCompleted).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (WebView.NavigationCompleted).

Definition

public int HttpStatusCode {get;}
webViewNavigationCompletedEventArgs.HttpStatusCode: int

Returns int

Examples

protected override void OnStart()
{
    var webView = new WebView();
    webView.NavigationCompleted += OnNavigationCompleted;
    Chart.AddControl(webView);
    webView.NavigateAsync("https://ctrader.com/");
}

private void OnNavigationCompleted(WebViewNavigationCompletedEventArgs args)
{
    if (args.HttpStatusCode == 404)
        Print("Page not found: {0}", args.Url);
}
def on_start(self):
    webView = WebView()
    webView.NavigationCompleted += self.on_navigation_completed
    api.Chart.AddControl(webView)
    webView.NavigateAsync("https://ctrader.com/")

def on_navigation_completed(self, args):
    if args.HttpStatusCode == 404:
        api.Print(f"Page not found: {args.Url}")