C Collections

chttpclient · Section 3

chttp_request_get_header

chttp_request_get_header - look up a request header by name

C Collections (libccollections, -lccollections)

#include <ccollections/chttpclient.h>
 
const char *chttp_request_get_header(const chttp_request *req,
                                     const char *name);

This function returns the stored value of the named header, or NULL if
the request has no such header. The lookup ignores case, because the
function lowercases your name before it looks it up.
 
The returned pointer stays valid until the next call to
chttp_request_set_header on this request, or until the request is
freed.

req   The request to query. It can be NULL, in which case the
      function returns NULL.
name  The header name. It can be NULL, in which case the function
      returns NULL.

A pointer to the stored value string, or NULL if the header is not
there.

chttp_request_set_header(3)