Skip to content

Commit ce36b8a

Browse files
authored
Highlight notes using markdown features (yhirose#1820)
1 parent 560854a commit ce36b8a

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ A C++11 single-file header-only cross platform HTTP/HTTPS library.
77

88
It's extremely easy to setup. Just include the **httplib.h** file in your code!
99

10-
NOTE: 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.
10+
> [!IMPORTANT]
11+
> 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.
1112
1213
Simple examples
1314
---------------
@@ -53,9 +54,11 @@ SSL Support
5354
5455
SSL support is available with `CPPHTTPLIB_OPENSSL_SUPPORT`. `libssl` and `libcrypto` should be linked.
5556
56-
NOTE: cpp-httplib currently supports only version 3.0 or later. Please see [this page](https://www.openssl.org/policies/releasestrat.html) to get more information.
57+
> [!NOTE]
58+
> cpp-httplib currently supports only version 3.0 or later. Please see [this page](https://www.openssl.org/policies/releasestrat.html) to get more information.
5759
58-
NOTE for macOS: cpp-httplib now can use system certs with `CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN`. `CoreFoundation` and `Security` should be linked with `-framework`.
60+
> [!TIP]
61+
> For macOS: cpp-httplib now can use system certs with `CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN`. `CoreFoundation` and `Security` should be linked with `-framework`.
5962
6063
```c++
6164
#define CPPHTTPLIB_OPENSSL_SUPPORT
@@ -76,7 +79,8 @@ cli.set_ca_cert_path("./ca-bundle.crt");
7679
cli.enable_server_certificate_verification(false);
7780
```
7881

79-
NOTE: When using SSL, it seems impossible to avoid SIGPIPE in all cases, since on some operating systems, SIGPIPE can only be suppressed on a per-message basis, but there is no way to make the OpenSSL library do so for its internal communications. If your program needs to avoid being terminated on SIGPIPE, the only fully general way might be to set up a signal handler for SIGPIPE to handle or ignore it yourself.
82+
> [!NOTE]
83+
> When using SSL, it seems impossible to avoid SIGPIPE in all cases, since on some operating systems, SIGPIPE can only be suppressed on a per-message basis, but there is no way to make the OpenSSL library do so for its internal communications. If your program needs to avoid being terminated on SIGPIPE, the only fully general way might be to set up a signal handler for SIGPIPE to handle or ignore it yourself.
8084
8185
Server
8286
------
@@ -190,7 +194,8 @@ The followings are built-in mappings:
190194
| webm | video/webm | zip | application/zip |
191195
| mp3 | audio/mp3 | wasm | application/wasm |
192196

193-
NOTE: These static file server methods are not thread-safe.
197+
> [!WARNING]
198+
> These static file server methods are not thread-safe.
194199
195200
### File request handler
196201

@@ -239,7 +244,8 @@ svr.set_exception_handler([](const auto& req, auto& res, std::exception_ptr ep)
239244
});
240245
```
241246

242-
NOTE: if you don't provide the `catch (...)` block for a rethrown exception pointer, an uncaught exception will end up causing the server crash. Be careful!
247+
> [!CAUTION]
248+
> if you don't provide the `catch (...)` block for a rethrown exception pointer, an uncaught exception will end up causing the server crash. Be careful!
243249
244250
### Pre routing handler
245251

@@ -417,7 +423,8 @@ svr.set_idle_interval(0, 100000); // 100 milliseconds
417423
svr.set_payload_max_length(1024 * 1024 * 512); // 512MB
418424
```
419425

420-
NOTE: When the request body content type is 'www-form-urlencoded', the actual payload length shouldn't exceed `CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH`.
426+
> [!NOTE]
427+
> When the request body content type is 'www-form-urlencoded', the actual payload length shouldn't exceed `CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH`.
421428
422429
### Server-Sent Events
423430

@@ -496,7 +503,8 @@ int main(void)
496503
}
497504
```
498505

499-
NOTE: Constructor with scheme-host-port string is now supported!
506+
> [!TIP]
507+
> Constructor with scheme-host-port string is now supported!
500508

501509
```c++
502510
httplib::Client cli("localhost");
@@ -704,7 +712,8 @@ cli.set_digest_auth("user", "pass");
704712
cli.set_bearer_token_auth("token");
705713
```
706714

707-
NOTE: OpenSSL is required for Digest Authentication.
715+
> [!NOTE]
716+
> OpenSSL is required for Digest Authentication.
708717
709718
### Proxy server support
710719

@@ -721,7 +730,8 @@ cli.set_proxy_digest_auth("user", "pass");
721730
cli.set_proxy_bearer_token_auth("pass");
722731
```
723732

724-
NOTE: OpenSSL is required for Digest Authentication.
733+
> [!NOTE]
734+
> OpenSSL is required for Digest Authentication.
725735
726736
### Range
727737

@@ -770,7 +780,8 @@ res->status; // 200
770780

771781
### Use a specific network interface
772782

773-
NOTE: This feature is not available on Windows, yet.
783+
> [!NOTE]
784+
> This feature is not available on Windows, yet.
774785
775786
```cpp
776787
cli.set_interface("eth0"); // Interface name, IP address or host name
@@ -859,9 +870,11 @@ Include `httplib.h` before `Windows.h` or include `Windows.h` by defining `WIN32
859870
#include <httplib.h>
860871
```
861872

862-
NOTE: cpp-httplib officially supports only the latest Visual Studio. It might work with former versions of Visual Studio, but I can no longer verify it. Pull requests are always welcome for the older versions of Visual Studio unless they break the C++11 conformance.
873+
> [!NOTE]
874+
> cpp-httplib officially supports only the latest Visual Studio. It might work with former versions of Visual Studio, but I can no longer verify it. Pull requests are always welcome for the older versions of Visual Studio unless they break the C++11 conformance.
863875
864-
NOTE: Windows 8 or lower, Visual Studio 2013 or lower, and Cygwin and MSYS2 including MinGW are neither supported nor tested.
876+
> [!NOTE]
877+
> Windows 8 or lower, Visual Studio 2013 or lower, and Cygwin and MSYS2 including MinGW are neither supported nor tested.
865878
866879
License
867880
-------

0 commit comments

Comments
 (0)