Skip to content

Commit 9c02ecc

Browse files
committed
Cleaner API (breaking change)
1 parent 3047183 commit 9c02ecc

File tree

3 files changed

+264
-515
lines changed

3 files changed

+264
-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++
@@ -672,7 +672,7 @@ auto res = cli.Get("/large-data",
672672
std::string body;
673673
674674
auto res = cli.Get(
675-
"/stream", Headers(),
675+
"/stream",
676676
[&](const Response &response) {
677677
EXPECT_EQ(StatusCode::OK_200, response.status);
678678
return true; // return 'false' if you want to cancel the request.
@@ -844,13 +844,13 @@ The default `Acdcept-Encoding` value contains all possible compression types. So
844844

845845
```c++
846846
res = cli.Get("/resource/foo");
847-
res = cli.Get("/resource/foo", {{"Accept-Encoding", "gzip, deflate, br"}});
847+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", "gzip, deflate, br"}});
848848
```
849849
850850
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.
851851
852852
```c++
853-
res = cli.Get("/resource/foo", {{"Accept-Encoding", ""}});
853+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", ""}});
854854
```
855855

856856
### Compress request body on client

0 commit comments

Comments
 (0)