Updated README
This commit is contained in:
parent
12540fe8d3
commit
9f5db2d1aa
21
README.md
21
README.md
@ -529,20 +529,27 @@ cli.set_ca_cert_path("./ca-bundle.crt");
|
|||||||
cli.enable_server_certificate_verification(true);
|
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 except text/event-stream
|
||||||
|
|
||||||
* all text types
|
|
||||||
* image/svg+xml
|
* image/svg+xml
|
||||||
* application/javascript
|
* application/javascript
|
||||||
* application/json
|
* application/json
|
||||||
* application/xml
|
* application/xml
|
||||||
* application/xhtml+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
|
### Compress request body on client
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
@ -554,7 +561,7 @@ res = cli.Post("/resource/foo", "...", "text/plain");
|
|||||||
|
|
||||||
```c++
|
```c++
|
||||||
cli.set_decompress(false);
|
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
|
res->body; // Compressed data
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user