Http module

expect_success

procedureextensionexperimentalSource

The status is 2xx.

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_success(response));
}

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

expect_success :: (response: Client_Response, loc := #caller_location) -> bool

Parameters

response: Client_Response
loc := #caller_location

Returns

bool

See also