From bee95654f312cb3bfdd9ef5b5d5e634c2e41b9d0 Mon Sep 17 00:00:00 2001 From: Evelyn Date: Fri, 22 Jul 2016 16:17:08 +0100 Subject: [PATCH] Update mg_http_parse_header.md --- docs/c-api/http.h/mg_http_parse_header.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/c-api/http.h/mg_http_parse_header.md b/docs/c-api/http.h/mg_http_parse_header.md index cd7beb6e..c6fbae6a 100644 --- a/docs/c-api/http.h/mg_http_parse_header.md +++ b/docs/c-api/http.h/mg_http_parse_header.md @@ -7,17 +7,17 @@ signature: | 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 +Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value +in the buffer `buf`, `buf_size`. Returns 0 if variable not found, non-zero otherwise. This function is supposed to parse -cookies, authentication headers, etcetera. Example (error handling omitted): +cookies, authentication headers, etc. 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, +Returns the length of the variable's value. If buffer is not large enough, or variable not found, 0 is returned.