How to set a flag (cpp-netlib)

I think my question is really trivial, but I can't get it to work nonetheless

std::string url="www.google.it";

boost::network::http::client client1_(_follow_redirects=true, _cache_resolved=true);
boost::network::http::client::request req(url);
boost::network::http::client::response resp = client1_.get(req);
std::cout << "Body: " << body(resp) << std::endl;

return 0;

the error, of course, refers to the declaration of flags ... but how can I set them?

/home/snake91/cpp_pricing/underlying.cpp:67: error: C ++ requires a type specifier for all declarations
    boost :: network :: http :: client client1 _ (_ follow_redirects = true, _cache_resolved = true);

                                      ^
+4
source share
1 answer
client::options options;
options.follow_redirects(true)
       .cache_resolved(true);

client client1_(options);

On this docs page: http://cpp-netlib.org/0.11.0/reference/http_client.html#general

+3
source

All Articles