Skip to content

Commit 3886251

Browse files
authored
Update README Get() examples to disambiguate Headers overload
1 parent c9f8168 commit 3886251

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ auto res = cli.Get("/hi", headers);
996996
or
997997

998998
```c++
999-
auto res = cli.Get("/hi", {{"Hello", "World!"}});
999+
auto res = cli.Get("/hi", httplib::Headers{{"Hello", "World!"}});
10001000
```
10011001
10021002
or
@@ -1240,7 +1240,7 @@ for details and for reading the variable from the environment.
12401240
```cpp
12411241
httplib::Client cli("httpcan.org");
12421242
1243-
auto res = cli.Get("/range/32", {
1243+
auto res = cli.Get("/range/32", httplib::Headers{
12441244
httplib::make_range_header({{1, 10}}) // 'Range: bytes=1-10'
12451245
});
12461246
// res->status should be 206.
@@ -1364,13 +1364,13 @@ The default `Accept-Encoding` value contains all possible compression types. So,
13641364

13651365
```c++
13661366
res = cli.Get("/resource/foo");
1367-
res = cli.Get("/resource/foo", {{"Accept-Encoding", "br, gzip, deflate, zstd"}});
1367+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", "br, gzip, deflate, zstd"}});
13681368
```
13691369
13701370
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.
13711371
13721372
```c++
1373-
res = cli.Get("/resource/foo", {{"Accept-Encoding", ""}});
1373+
res = cli.Get("/resource/foo", httplib::Headers{{"Accept-Encoding", ""}});
13741374
```
13751375

13761376
### Compress request body on client

0 commit comments

Comments
 (0)