#include <aws/core/http/curl/CurlHttpClient.h>
#include <aws/core/http/HttpRequest.h>
#include <aws/core/http/HttpResponse.h>
Aws::String url = "http://www.csdn.net.cn";
SDKOptions options;
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Error;
InitAPI(options);
Aws::Http::CurlHttpClient::InitGlobalState();
auto client = Aws::MakeShared<Aws::Http::CurlHttpClient>("Alloc", Aws::Client::ClientConfiguration());
auto uri = Aws::Http::URI(url);
auto request = Aws::MakeShared<Aws::Http::Standard::StandardHttpRequest>("Alloc", uri, Aws::Http::HttpMethod::HTTP_GET);
request->SetResponseStreamFactory(Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
auto response = client->MakeRequest(request);
Aws::IOStream &retrieved_file = response->GetResponseBody();
retrieved_file.seekg(0, retrieved_file.end);
int length = retrieved_file.tellg();
retrieved_file.seekg(0, retrieved_file.beg);
char *content = new char[length + 1];
memset(content, 0x00, length + 1);
retrieved_file.read(content, length);
SetConfig(conf, content);
delete[] content;
Aws::Http::CurlHttpClient::CleanupGlobalState();
ShutdownAPI(options);