From 35b517b434fb69428584269b8ae27d965a11aa68 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Sat, 4 Jun 2022 08:29:03 +0100 Subject: [PATCH] docs --- docs/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/README.md b/docs/README.md index 255921ca..71bbcfb6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1303,20 +1303,21 @@ Parameters: Return value: offset to the next chunk, or 0 if there are no more chunks. -See [File upload tutorial](../tutorials/file-uploads/) for full usage example. +Usage example (or see [form upload tutorial](../tutorials/form-uploads/) ): + +```c +struct mg_http_part part; +size_t pos = 0; + +while ((pos = mg_http_next_multipart(body, pos, &part)) != 0) { + // Use part +} +``` A diagram below shows how `mg_http_next_multipart()` in action: Function mg_http_next_multipart() -Usage example: - -```c -struct mg_http_part part; -if(mg_http_next_multipart(body, 0 /* begin */, &part)) { - // Use part -} -``` ## Websocket