Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
bee95654
Commit
bee95654
authored
Jul 22, 2016
by
Evelyn
Committed by
GitHub
Jul 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update mg_http_parse_header.md
parent
48296bb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mg_http_parse_header.md
docs/c-api/http.h/mg_http_parse_header.md
+4
-4
No files found.
docs/c-api/http.h/mg_http_parse_header.md
View file @
bee95654
...
@@ -7,17 +7,17 @@ signature: |
...
@@ -7,17 +7,17 @@ signature: |
size_t buf_size);
size_t buf_size);
---
---
Parse
HTTP header
`hdr`
. Find variable
`var_name`
and store it'
s value
Parse
s the HTTP header
`hdr`
. Finds variable
`var_name`
and stores it
s value
in the buffer
`buf`
,
`buf_size`
. Return 0 if variable not found, non-zero
in the buffer
`buf`
,
`buf_size`
. Return
s
0 if variable not found, non-zero
otherwise.
otherwise.
This function is supposed to parse
This function is supposed to parse
cookies, authentication headers, etc
etera
. Example (error handling omitted):
cookies, authentication headers, etc. Example (error handling omitted):
char user[20];
char user[20];
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
mg_http_parse_header(hdr, "username", user, sizeof(user));
mg_http_parse_header(hdr, "username", user, sizeof(user));
Return length of the variable's value. If buffer is not large enough,
Return
s the
length of the variable's value. If buffer is not large enough,
or variable not found, 0 is returned.
or variable not found, 0 is returned.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment