#include <iostream>
string url =
"http://www.google.es/";
{
string content;
string errmsg;
cout <<
"Retrieving " <<
url <<
"..." << endl;
url, content, errmsg, 80,
"",
"",
nullptr,
nullptr, &out_headers);
{
cout << " Error: " << errmsg << endl;
return;
}
string typ = out_headers.
has(
"Content-Type") ? out_headers[
"Content-Type"]
: string("???");
cout << "Ok: " << content.size() << " bytes of type: " << typ << endl;
}
{
try
{
return 0;
}
catch (const std::exception& e)
{
return -1;
}
}