#define CPPHTTPLIB_OPENSSL_SUPPORT #include "path/to/httplib.h" // HTTP httplib::Client cli("http://yhirose.github.io"); // HTTPS httplib::Client cli("https://yhirose.github.io"); auto res = cli.Get("/hi"); res->status; res->body;...
cpp-httplib A C++ single-file header-only cross platform HTTP/HTTPS library. It's extremely easy to setup. Just includehttplib.hfile in your code! Server Example #include<httplib.h>intmain(void) {usingnamespacehttplib;Server svr; svr.Get("/hi", [](constRequest& req, Response& res) { ...
Brotli compression is available withCPPHTTPLIB_BROTLI_SUPPORT. Necessary libraries should be linked. Please seehttps://github.com/google/brotlifor more detail. cli.set_decompress(false); res = cli.Get("/resource/foo", {{"Accept-Encoding","gzip, deflate, br"}}); res->body;//Compressed data...
httplib::Clientcli("http://cpp-httplib-server.yhirose.repl.co");autores = cli.Get("/hi"); res->status;//200res->body;//"Hello World!" Try out the examples on Repl.it! Server #include<httplib.h>intmain(void) {usingnamespacehttplib;Server svr; svr.Get("/hi", [](constRequest&...
cpp-httplib A C++ single-file header-only cross platform HTTP/HTTPS library. It's extremely easy to setup. Just includehttplib.hfile in your code! Server Example #include<httplib.h>intmain(void) {usingnamespacehttplib;Server svr; svr.Get("/hi", [](constRequest& req, Response& res) { ...
Please see https://github.com/google/brotli for more detail.Compress request body on clientcli.set_compress(true); res = cli.Post("/resource/foo", "...", "text/plain");Compress response body on clientcli.set_decompress(false); res = cli.Get(...
Please see https://github.com/google/brotli for more detail.Compress request body on clientcli.set_compress(true); res = cli.Post("/resource/foo", "...", "text/plain");Compress response body on clientcli.set_decompress(false); res = cli.Get(...
Please see https://github.com/google/brotli for more detail.Compress request body on clientcli.set_compress(true); res = cli.Post("/resource/foo", "...", "text/plain");Compress response body on clientcli.set_decompress(false); res = cli.Get("/resource/foo", {{"Accept-Encoding", ...
Please see https://github.com/google/brotli for more detail.Default Accept-Encoding valueThe default Acdcept-Encoding value contains all possible compression types. So, the following two examples are same.res = cli.Get("/resource/foo"); res = cli.Get("/resource/foo", {{"Accept-Encoding",...
C++11 header-only HTTP/HTTPS sever library. Contribute to corefan/cpp-httplib development by creating an account on GitHub.