Initial client API V2
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user