Skip to content
HttpHeadersFind

HttpHeadersFind

Description

Find a header by key (case-sensitive zero-terminated comparison).

Success

Pointer to the matching header inside the vector.

Failure

NULL if no header matches.

Usage example (Cross-references)

Usage examples (Cross-references)
                  (ZstrCompare(next, "body-bytes") == 0);
    
        HttpHeader *host = HttpHeadersFind(&req.headers, "Host");
        ok               = ok && host && ZstrCompare(host->value.data, "example.com") == 0;
    }
    
    HttpHeader *HttpHeadersFind(HttpHeaders *headers, const char *key) {
        if (!headers || !key) {
            LOG_ERROR("invalid arguments");
Last updated on