Skip to content

Commit 335246b

Browse files
committed
Cleaner API (breaking change)
1 parent 321a86d commit 335246b

File tree

3 files changed

+262
-515
lines changed

3 files changed

+262
-515
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ auto res = cli.Get("/hi", headers);
578578
```
579579
or
580580
```c++
581-
auto res = cli.Get("/hi", {{"Hello", "World!"}});
581+
auto res = cli.Get("/hi", httplib::Headers{{"Hello", "World!"}});
582582
```
583583
or
584584
```c++
@@ -675,7 +675,7 @@ auto res = cli.Get("/large-data",
675675
std::string body;
676676
677677
auto res = cli.Get(
678-
"/stream", Headers(),
678+
"/stream",
679679
[&](const Response &response) {
680680
EXPECT_EQ(StatusCode::OK_200, response.status);
681681
return true; // return 'false' if you want to cancel the request.
@@ -847,13 +847,13 @@ The default `Accept-Encoding` value contains all possible compression types. So,
847847

848848
```c++
849849
res = cli.Get("/resource/foo");
850-
res = cli.Get("/resource/foo", {{"Accept-Encoding", "gzip, deflate, br"}});
850+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", "gzip, deflate, br"}});
851851
```
852852
853853
If we don't want a response without compression, we have to set `Accept-Encoding` to an empty string. This behavior is similar to curl.
854854
855855
```c++
856-
res = cli.Get("/resource/foo", {{"Accept-Encoding", ""}});
856+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", ""}});
857857
```
858858

859859
### Compress request body on client

0 commit comments

Comments
 (0)