From 6cde600922dc0254517e0558b711c20c07bb66c1 Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 29 Jul 2020 16:04:28 -0400 Subject: [PATCH] Simplified simplecli.cc --- example/simplecli.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/example/simplecli.cc b/example/simplecli.cc index 86efdea..e43434f 100644 --- a/example/simplecli.cc +++ b/example/simplecli.cc @@ -8,20 +8,17 @@ #include #include -#define CA_CERT_FILE "./ca-bundle.crt" - using namespace std; int main(void) { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT - auto res = httplib::Client2("https://localhost:8080") - .set_ca_cert_path(CA_CERT_FILE) - // .enable_server_certificate_verification(true) - .Get("/hi"); + auto scheme_host_port = "https://localhost:8080"; #else - auto res = httplib::Client2("http://localhost:8080").Get("/hi"); + auto scheme_host_port = "http://localhost:8080"; #endif + auto res = httplib::Client2(scheme_host_port).Get("/hi"); + if (res) { cout << res->status << endl; cout << res->get_header_value("Content-Type") << endl;