From 024add39d3ca925dc771ffc44ce795dcca92a0f3 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Tue, 9 Feb 2016 03:21:48 +0200 Subject: [PATCH] more readme changes --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 33f98b3..70d9e61 100644 --- a/README.md +++ b/README.md @@ -223,8 +223,9 @@ request->send(response); ### Respond with content using a callback ```cpp //send 128 bytes as plain text -request->send("text/plain", 128, [](uint8_t *buffer, size_t maxLen) -> size_t { +request->send("text/plain", 128, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t { //Write up to "maxLen" bytes into "buffer" and return the amount written. + //index equals the amount of bytes that have been already sent //You will not be asked for more bytes once the content length has been reached. //Keep in mind that you can not delay or yield waiting for more data! //Send what you currently have and you will be asked for more again @@ -377,7 +378,7 @@ than providing the length of the content ### Respond with content using a callback without content length ```cpp //This is used as fallback for chunked responses to HTTP/1.0 Clients -request->send("text/plain", 0, [](uint8_t *buffer, size_t maxLen) -> size_t { +request->send("text/plain", 0, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t { //Write up to "maxLen" bytes into "buffer" and return the amount written. //You will be asked for more data until 0 is returned //Keep in mind that you can not delay or yield waiting for more data!