Skip to content

Commit c496094

Browse files
committed
Refactor streaming API tests and update Makefile for new test execution
1 parent 1582bb2 commit c496094

File tree

6 files changed

+464
-545
lines changed

6 files changed

+464
-545
lines changed

README-stream.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ cpp-httplib provides multiple API layers for different use cases:
4848
## Requirements
4949

5050
- C++20 compiler with coroutine support
51-
- Include `httplib-stream.h` (which includes `httplib.h`)
51+
- Include `httplib.h` and compile with `-std=c++20`
5252

5353
## Quick Start
5454

5555
```cpp
56-
#include "httplib-stream.h"
56+
#include "httplib.h"
5757

5858
int main() {
5959
httplib::Client cli("http://localhost:8080");
@@ -112,10 +112,10 @@ if (handle.is_valid()) {
112112
113113
### High-Level API: `stream::Get()` and `stream::Result`
114114
115-
The `httplib-stream.h` header provides a more ergonomic API using C++20 coroutines.
115+
The `httplib.h` header provides a more ergonomic API using C++20 coroutines (requires C++20).
116116
117117
```cpp
118-
#include "httplib-stream.h"
118+
#include "httplib.h"
119119
120120
httplib::Client cli("http://localhost:8080");
121121
@@ -155,7 +155,7 @@ for (auto chunk : result.body(1024)) {
155155
### Example 1: SSE (Server-Sent Events) Client
156156

157157
```cpp
158-
#include "httplib-stream.h"
158+
#include "httplib.h"
159159
#include <iostream>
160160

161161
int main() {
@@ -177,7 +177,7 @@ For a complete SSE client with auto-reconnection and event parsing, see `example
177177
### Example 2: LLM Streaming Response
178178

179179
```cpp
180-
#include "httplib-stream.h"
180+
#include "httplib.h"
181181
#include <iostream>
182182

183183
int main() {
@@ -203,7 +203,7 @@ int main() {
203203
### Example 3: Large File Download with Progress
204204

205205
```cpp
206-
#include "httplib-stream.h"
206+
#include "httplib.h"
207207
#include <fstream>
208208
#include <iostream>
209209

@@ -319,6 +319,5 @@ clang++ -std=c++20 -o myapp myapp.cpp -lpthread -lssl -lcrypto
319319
## Related
320320

321321
- [Issue #2269](https://github.com/yhirose/cpp-httplib/issues/2269) - Original feature request
322-
- [httplib.h](./httplib.h) - Main library
323-
- [httplib-stream.h](./httplib-stream.h) - C++20 extensions
322+
- [httplib.h](./httplib.h) - Main library (includes C++20 streaming API)
324323
- [example/ssecli-stream.cc](./example/ssecli-stream.cc) - SSE client with auto-reconnection

0 commit comments

Comments
 (0)