From 96afa7e1087763b3cf4c0cf6b258e0eca84acfd6 Mon Sep 17 00:00:00 2001 From: yhirose Date: Mon, 21 Dec 2020 13:40:32 -0500 Subject: [PATCH] Updated README --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1800c9f..2b775fc 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,13 @@ Simple examples #### Server ```c++ +// HTTP httplib::Server svr; +// HTTPS +#define CPPHTTPLIB_OPENSSL_SUPPORT +httplib::SSLServer svr; + svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) { res.set_content("Hello World!", "text/plain"); }); @@ -27,12 +32,14 @@ svr.listen("0.0.0.0", 8080); #### Client ```c++ -#define CPPHTTPLIB_OPENSSL_SUPPORT +// HTTP +httplib::Client cli("http://cpp-httplib-server.yhirose.repl.co"); +// HTTPS +#define CPPHTTPLIB_OPENSSL_SUPPORT httplib::Client cli("https://cpp-httplib-server.yhirose.repl.co"); auto res = cli.Get("/hi"); - res->status; res->body; ```