@@ -17,6 +17,33 @@ The C++20 streaming API allows you to process HTTP response bodies chunk by chun
1717- ** Large file downloads** with progress tracking
1818- ** Reverse proxy implementations**
1919
20+ ## Requirements
21+
22+ - C++20 compiler with coroutine support
23+ - Include ` httplib.h ` and compile with ` -std=c++20 `
24+
25+ ## Quick Start
26+
27+ ``` cpp
28+ #include " httplib.h"
29+
30+ int main () {
31+ httplib::Client cli("http://localhost:8080");
32+
33+ // Get streaming response
34+ auto result = httplib::stream::Get(cli, "/stream");
35+
36+ if (result) {
37+ // Process response body in chunks
38+ for (auto chunk : result.body(4096)) {
39+ std::cout << chunk; // Process each chunk as it arrives
40+ }
41+ }
42+
43+ return 0;
44+ }
45+ ```
46+
2047## API Layers
2148
2249cpp-httplib provides multiple API layers for different use cases:
@@ -45,33 +72,6 @@ cpp-httplib provides multiple API layers for different use cases:
4572| Reverse proxy | ` open_stream() ` |
4673| Small responses with Keep-Alive | ` Client::Get() ` |
4774
48- ## Requirements
49-
50- - C++20 compiler with coroutine support
51- - Include ` httplib.h ` and compile with ` -std=c++20 `
52-
53- ## Quick Start
54-
55- ``` cpp
56- #include " httplib.h"
57-
58- int main () {
59- httplib::Client cli("http://localhost:8080");
60-
61- // Get streaming response
62- auto result = httplib::stream::Get(cli, "/stream");
63-
64- if (result) {
65- // Process response body in chunks
66- for (auto chunk : result.body(4096)) {
67- std::cout << chunk; // Process each chunk as it arrives
68- }
69- }
70-
71- return 0;
72- }
73- ```
74-
7575## API Reference
7676
7777### Low-Level API: ` StreamHandle `
0 commit comments