You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's extremely easy to setup. Just include the **httplib.h** file in your code!
9
9
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.
11
12
12
13
Simple examples
13
14
---------------
@@ -53,9 +54,11 @@ SSL Support
53
54
54
55
SSL support is available with `CPPHTTPLIB_OPENSSL_SUPPORT`. `libssl` and `libcrypto` should be linked.
55
56
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.
57
59
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`.
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.
80
84
81
85
Server
82
86
------
@@ -190,7 +194,8 @@ The followings are built-in mappings:
190
194
| webm | video/webm | zip | application/zip |
191
195
| mp3 | audio/mp3 | wasm | application/wasm |
192
196
193
-
NOTE: These static file server methods are not thread-safe.
197
+
> [!WARNING]
198
+
> These static file server methods are not thread-safe.
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!
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`.
421
428
422
429
### Server-Sent Events
423
430
@@ -496,7 +503,8 @@ int main(void)
496
503
}
497
504
```
498
505
499
-
NOTE: Constructor with scheme-host-port string is now supported!
506
+
> [!TIP]
507
+
> Constructor with scheme-host-port string is now supported!
NOTE: OpenSSL is required for Digest Authentication.
733
+
> [!NOTE]
734
+
> OpenSSL is required for Digest Authentication.
725
735
726
736
### Range
727
737
@@ -770,7 +780,8 @@ res->status; // 200
770
780
771
781
### Use a specific network interface
772
782
773
-
NOTE: This feature is not available on Windows, yet.
783
+
> [!NOTE]
784
+
> This feature is not available on Windows, yet.
774
785
775
786
```cpp
776
787
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
859
870
#include<httplib.h>
860
871
```
861
872
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.
863
875
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.
0 commit comments