mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Updated README
This commit is contained in:
parent
12540fe8d3
commit
9f5db2d1aa
1 changed files with 14 additions and 7 deletions
21
README.md
21
README.md
|
@ -529,20 +529,27 @@ cli.set_ca_cert_path("./ca-bundle.crt");
|
|||
cli.enable_server_certificate_verification(true);
|
||||
```
|
||||
|
||||
Zlib Support
|
||||
------------
|
||||
Compression
|
||||
-----------
|
||||
|
||||
'gzip' compression is available with `CPPHTTPLIB_ZLIB_SUPPORT`. `libz` should be linked.
|
||||
The server can applie compression to the following MIME type contents:
|
||||
|
||||
The server applies gzip compression to the following MIME type contents:
|
||||
|
||||
* all text types
|
||||
* all text types except text/event-stream
|
||||
* image/svg+xml
|
||||
* application/javascript
|
||||
* application/json
|
||||
* application/xml
|
||||
* application/xhtml+xml
|
||||
|
||||
### Zlib Support
|
||||
|
||||
'gzip' compression is available with `CPPHTTPLIB_ZLIB_SUPPORT`. `libz` should be linked.
|
||||
|
||||
### Brotli Support
|
||||
|
||||
Brotli compression is available with `CPPHTTPLIB_BROTLI_SUPPORT`. Necessary libraries should be linked.
|
||||
Please see https://github.com/google/brotli for more detail.
|
||||
|
||||
### Compress request body on client
|
||||
|
||||
```c++
|
||||
|
@ -554,7 +561,7 @@ res = cli.Post("/resource/foo", "...", "text/plain");
|
|||
|
||||
```c++
|
||||
cli.set_decompress(false);
|
||||
res = cli.Get("/resource/foo", {{"Accept-Encoding", "gzip, deflate"}});
|
||||
res = cli.Get("/resource/foo", {{"Accept-Encoding", "gzip, deflate, br"}});
|
||||
res->body; // Compressed data
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue