Http module

expect_status

procedureextensionexperimentalSource

The status of the response is exactly status.

Example
hello :: () -> string {
    return "hello";
}

main :: () {
    app: App;
    defer free_app(*app);

    get(*app, "/hello", hello);

    api := test_client(*app);

    response, _ := get(api, "/hello");
    defer close(*response);

    assert(expect_status(response, 200));
}

Doesn't run in the browser (skipped on wasm).

expect_status :: (
    response: Client_Response,
    status: int,
    loc := #caller_location
) -> bool

Parameters

response: Client_Response
status: int
loc := #caller_location

Returns

bool

See also