Initial client API V2

This commit is contained in:
Chunting Gu
2019-03-06 11:13:33 +08:00
parent b38b7e6d38
commit 9b8304f06c
38 changed files with 777 additions and 362 deletions
+4 -8
View File
@@ -4,25 +4,21 @@
#include "webcc/logger.h"
int main(int argc, char* argv[]) {
std::string host;
std::string url;
if (argc != 3) {
host = "www.boost.org";
url = "/LICENSE_1_0.txt";
url = "www.boost.org/LICENSE_1_0.txt";
} else {
host = argv[1];
url = argv[2];
url = argv[1];
}
std::cout << "Host: " << host << std::endl;
std::cout << "URL: " << url << std::endl;
std::cout << std::endl;
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
// Leave port to default value.
webcc::HttpRequest request(webcc::kHttpGet, url, host);
webcc::HttpRequest request(webcc::http::kGet, url);
request.Prepare();
@@ -30,7 +26,7 @@ int main(int argc, char* argv[]) {
// See HttpSslClient::Request() for more details.
bool ssl_verify = false;
webcc::HttpSslClient client(2000, ssl_verify);
webcc::HttpSslClient client(ssl_verify, 2000);
if (client.Request(request)) {
//std::cout << client.response()->content() << std::endl;