diff --git a/docs/README.md b/docs/README.md index 134cafec..68ee8098 100644 --- a/docs/README.md +++ b/docs/README.md @@ -865,7 +865,7 @@ const char *buf = "GET /test \n\nGET /foo\n\n"; int req_len = mg_http_get_request_len(buf, strlen(buf)); // req_len == 12 ``` - + ### mg\_http\_parse() diff --git a/docs/images/mg_http_get_request_len.svg b/docs/images/mg_http_get_request_len.svg new file mode 100644 index 00000000..dd8aec62 --- /dev/null +++ b/docs/images/mg_http_get_request_len.svg @@ -0,0 +1,46 @@ + + + + + +GET /test \n\nGET /test \n\nGET test \n\n + + + + + + + 1st request + + + + + + + 2nd request + + + + + + + 3rd request + + + + + + diff --git a/docs/images/mg_http_message.svg b/docs/images/mg_http_message.svg new file mode 100644 index 00000000..3207617c --- /dev/null +++ b/docs/images/mg_http_message.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + +struct mg_http_message { +struct mg_str method; uri, query, proto; struct mg_http_header headers[MG_MAX_HTTP_HEADERS];struct mg_str body;struct mg_str message; + + + + + + + + + + + + + + + +POST /foo/bar/baz?aa=b&cc=ddd HTTP/1.1Content-Type: application/jsonContent-Length: 19Host: reqbin.com + + + + + + + + + + + + + + + + + + + + +{"success": "true"} + +Source Code +HTTP message +}; + + + + + + + + +