Skip to content
On this page

Http Status Codes

You can declaratively check the status code with this syntax:

public async Task check_the_status(IAlbaHost system)
    await system.Scenario(_ =>
        // Shorthand for saying that the StatusCode should be 200

        // Or a specific status code

        // Ignore the status code altogether

snippet source | anchor

Do note that by default, if you do not specify the expected status code, Alba assumes that the request should return 200 (OK) and will fail the scenario if a different status code is found. You can ignore that check with the Scenario.IgnoreStatusCode() method.