Closed ghost closed 2 years ago
To set timeout you should use this format: std::chrono::milliseconds{ 100 }
Use braces instead of parentheses
To set timeout you should use this format: std::chrono::milliseconds{ 100 }
Use braces instead of parentheses
Thanks you so much i waited 1 year for your help
I just want to understand what i am doing wrong :/
string webRequest(std::string path) { try { http::Request request{ serverUrl + path }; const auto response = request.send("GET", std::chrono::seconds(2)); // <--- Error pointed (When i remove the chrono, it works but the request never get any timeout, so never catched std::cout << "RESPONSe : " << response.status; return std::string{ response.body.begin(), response.body.end() }; } catch (const std::exception& e) { std::cout << e.what(); return ""; // Failed, don't crash but return no response. } }
Error (active) E0304 no instance of overloaded function "http::Request::send" matches the argument list