mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Added 'With Progress Callback' section to README
This commit is contained in:
parent
ad5fba498e
commit
cef64d5f24
1 changed files with 19 additions and 0 deletions
19
README.md
19
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<httplib::Response> res =
|
||||||
|
cli.get("/", [](int64_t len, int64_t total) {
|
||||||
|
printf("%lld / %lld bytes => %d%% complete\n",
|
||||||
|
len, total,
|
||||||
|
(int)((len/total)*100));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This feature has been contributed by @underscorediscovery.
|
||||||
|
|
||||||
OpenSSL Support
|
OpenSSL Support
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue