From cef64d5f244d15b5b33f107fdd510ead4da595f7 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 24 Nov 2017 21:39:17 -0500 Subject: [PATCH] Added 'With Progress Callback' section to README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index ddb339a..1c5d82e 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,25 @@ int main(void) } ``` +### With Progress Callback + +```cpp +httplib::Client client(url, port); + +// prints: 0 / 000 bytes => 50% complete +std::shared_ptr res = + cli.get("/", [](int64_t len, int64_t total) { + printf("%lld / %lld bytes => %d%% complete\n", + len, total, + (int)((len/total)*100)); + } +); +``` + +![progress](https://user-images.githubusercontent.com/236374/33138910-495c4ecc-cf86-11e7-8693-2fc6d09615c4.gif) + +This feature has been contributed by @underscorediscovery. + OpenSSL Support ---------------