#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"]
cout << "Ok: " << content.size() << " bytes of type: " << typ << endl;
}
int main(
int argc,
char** argv)
{
try
{
return 0;
}
catch (std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
return -1;
}
catch (...)
{
printf("Untyped exception!");
return -1;
}
}