mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-05 10:58:59 +08:00
23122b327c
It would be probably good idea to also remove tools/docgen.py and asciidoc.mk, but asciidoc.mk is still mentioned under `cloud/doc`, which may contain some useful info which we'll need at least to review before removing. PUBLISHED_FROM=faf454d4c52a2f07ea8ac084cf0bd11a0c9c9b3b
762 B
762 B
title | decl_name | symbol_kind | signature |
---|---|---|---|
mg_http_parse_header() | mg_http_parse_header | func | int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf, size_t buf_size); |
Parse HTTP header hdr
. Find variable var_name
and store it's value
in the buffer buf
, buf_size
. Return 0 if variable not found, non-zero
otherwise.
This function is supposed to parse cookies, authentication headers, etcetera. Example (error handling omitted):
char user[20];
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
mg_http_parse_header(hdr, "username", user, sizeof(user));
Return length of the variable's value. If buffer is not large enough, or variable not found, 0 is returned.