Skip to content

Commit 696c02f

Browse files
committed
Update README
1 parent a183dba commit 696c02f

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cpp-httplib
55

66
A C++11 single-file header-only cross platform HTTP/HTTPS library.
77

8-
It's extremely easy to setup. Just include the **httplib.h** file in your code!
8+
It's extremely easy to set up. Just include the **httplib.h** file in your code!
99

1010
> [!IMPORTANT]
1111
> This library uses 'blocking' socket I/O. If you are looking for a library with 'non-blocking' socket I/O, this is not the one that you want.
@@ -187,7 +187,7 @@ svr.set_file_extension_and_mimetype_mapping("cpp", "text/x-c");
187187
svr.set_file_extension_and_mimetype_mapping("hh", "text/x-h");
188188
```
189189

190-
The followings are built-in mappings:
190+
The following are built-in mappings:
191191

192192
| Extension | MIME Type | Extension | MIME Type |
193193
| :--------- | :-------------------------- | :--------- | :-------------------------- |
@@ -201,7 +201,7 @@ The followings are built-in mappings:
201201
| bmp | image/bmp | 7z | application/x-7z-compressed |
202202
| gif | image/gif | atom | application/atom+xml |
203203
| png | image/png | pdf | application/pdf |
204-
| svg | image/svg+xml | mjs, js | application/javascript |
204+
| svg | image/svg+xml | mjs, js | text/javascript |
205205
| webp | image/webp | json | application/json |
206206
| ico | image/x-icon | rss | application/rss+xml |
207207
| tif | image/tiff | tar | application/x-tar |
@@ -451,7 +451,7 @@ svr.set_expect_100_continue_handler([](const Request &req, Response &res) {
451451
### Keep-Alive connection
452452

453453
```cpp
454-
svr.set_keep_alive_max_count(2); // Default is 5
454+
svr.set_keep_alive_max_count(2); // Default is 100
455455
svr.set_keep_alive_timeout(10); // Default is 5
456456
```
457457

@@ -578,9 +578,11 @@ enum Error {
578578
SSLConnection,
579579
SSLLoadingCerts,
580580
SSLServerVerification,
581+
SSLServerHostnameVerification,
581582
UnsupportedMultipartBoundaryChars,
582583
Compression,
583584
ConnectionTimeout,
585+
ProxyConnection,
584586
};
585587
```
586588

@@ -672,7 +674,7 @@ cli.set_read_timeout(5, 0); // 5 seconds
672674
cli.set_write_timeout(5, 0); // 5 seconds
673675

674676
// This method works the same as curl's `--max-time` option
675-
svr.set_max_timeout(5000); // 5 seconds
677+
cli.set_max_timeout(5000); // 5 seconds
676678
```
677679

678680
### Receive content with a content receiver
@@ -846,6 +848,7 @@ The server can apply compression to the following MIME type contents:
846848
* application/javascript
847849
* application/json
848850
* application/xml
851+
* application/protobuf
849852
* application/xhtml+xml
850853

851854
### Zlib Support
@@ -857,13 +860,18 @@ The server can apply compression to the following MIME type contents:
857860
Brotli compression is available with `CPPHTTPLIB_BROTLI_SUPPORT`. Necessary libraries should be linked.
858861
Please see https://github.com/google/brotli for more detail.
859862

863+
### Zstd Support
864+
865+
Zstd compression is available with `CPPHTTPLIB_ZSTD_SUPPORT`. Necessary libraries should be linked.
866+
Please see https://github.com/facebook/zstd for more detail.
867+
860868
### Default `Accept-Encoding` value
861869

862870
The default `Accept-Encoding` value contains all possible compression types. So, the following two examples are same.
863871

864872
```c++
865873
res = cli.Get("/resource/foo");
866-
res = cli.Get("/resource/foo", {{"Accept-Encoding", "gzip, deflate, br"}});
874+
res = cli.Get("/resource/foo", {{"Accept-Encoding", "br, gzip, deflate, zstd"}});
867875
```
868876
869877
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.
@@ -903,7 +911,7 @@ httplib::Client cli("./my-socket.sock");
903911
cli.set_address_family(AF_UNIX);
904912
```
905913
906-
"my-socket.sock" can be a relative path or an absolute path. You application must have the appropriate permissions for the path. You can also use an abstract socket address on Linux. To use an abstract socket address, prepend a null byte ('\x00') to the path.
914+
"my-socket.sock" can be a relative path or an absolute path. Your application must have the appropriate permissions for the path. You can also use an abstract socket address on Linux. To use an abstract socket address, prepend a null byte ('\x00') to the path.
907915
908916
909917
Split httplib.h into .h and .cc

0 commit comments

Comments
 (0)