Skip to content
HttpResponseCodeToZstr

HttpResponseCodeToZstr

Description

Wire-format lookup tables.

Success

Returns the canonical HTTP/1.1 reason-phrase string for the given code / content type. The pointer is to static storage and is valid for the lifetime of the program.

Failure

Returns "Unknown" for codes / content types outside the recognised enum range. Cannot fail.

Usage example (Cross-references)

Usage examples (Cross-references)
    // ---------------------------------------------------------------------------
    
    Zstr HttpResponseCodeToZstr(HttpResponseCode code) {
        switch (code) {
            case HTTP_RESPONSE_CODE_CONTINUE :
        }
    
        Zstr response_code = HttpResponseCodeToZstr(response->status_code);
        if (!response_code) {
            LOG_ERROR("HttpResponseSerialize: invalid/unknown response code {}", (u32)response->status_code);
Last updated on