1
0
mirror of synced 2025-12-06 11:20:56 +03:00

Update README

This commit is contained in:
yhirose
2025-12-02 17:08:53 -05:00
parent 8bba34eebc
commit 1d36013fc3
2 changed files with 5 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ The `StreamHandle` struct provides direct control over streaming responses. It t
```cpp ```cpp
// Open a stream (takes ownership of socket) // Open a stream (takes ownership of socket)
httplib::Client cli("http://localhost:8080"); httplib::Client cli("http://localhost:8080");
auto handle = cli.open_stream("/path"); auto handle = cli.open_stream("GET", "/path");
// Check validity // Check validity
if (handle.is_valid()) { if (handle.is_valid()) {
@@ -114,6 +114,8 @@ The `httplib.h` header provides a more ergonomic iterator-style API.
#include "httplib.h" #include "httplib.h"
httplib::Client cli("http://localhost:8080"); httplib::Client cli("http://localhost:8080");
cli.set_follow_location(true);
...
// Simple GET // Simple GET
auto result = httplib::stream::Get(cli, "/path"); auto result = httplib::stream::Get(cli, "/path");

View File

@@ -1195,6 +1195,8 @@ Process large responses without loading everything into memory.
```c++ ```c++
httplib::Client cli("localhost", 8080); httplib::Client cli("localhost", 8080);
cli.set_follow_location(true);
...
auto result = httplib::stream::Get(cli, "/large-file"); auto result = httplib::stream::Get(cli, "/large-file");
if (result) { if (result) {