Skip to content

Commit 47e5af1

Browse files
committed
Updated README
1 parent a5c239c commit 47e5af1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ auto res = cli.Get(
502502
```cpp
503503
std::string body = ...;
504504

505-
auto res = cli_.Post(
505+
auto res = cli.Post(
506506
"/stream", body.size(),
507507
[](size_t offset, size_t length, DataSink &sink) {
508508
sink.write(body.data() + offset, length);
@@ -511,6 +511,21 @@ auto res = cli_.Post(
511511
"text/plain");
512512
```
513513
514+
### Chunked transfer encoding
515+
516+
```cpp
517+
auto res = cli.Post(
518+
"/stream",
519+
[](size_t offset, DataSink &sink) {
520+
sink.os << "chunked data 1";
521+
sink.os << "chunked data 2";
522+
sink.os << "chunked data 3";
523+
sink.done();
524+
return true; // return 'false' if you want to cancel the request.
525+
},
526+
"text/plain");
527+
```
528+
514529
### With Progress Callback
515530

516531
```cpp

0 commit comments

Comments
 (0)