In this section of code, when the post request body comes empty the application breaks. Is it the expected behavior ?
else if (request.method == method_t::POST) {
try {
if (request.body.empty())
throw;
possible_prime = std::stoul(request.body);
} catch (...) {
throw std::runtime_error(
"POST requests should have a path of 'is_prime' and a body with 'SOME_NUMBER'");
}