260 static const std::unordered_map<ResponseCodes, std::string> responseMessage =
262 { ResponseCodes::Continue,
"Continue" },
263 { ResponseCodes::switchingProtocols,
"Switching Protocols" },
264 { ResponseCodes::processing,
"Processing" },
265 { ResponseCodes::ok,
"OK" },
266 { ResponseCodes::created,
"Created" },
267 { ResponseCodes::accepted,
"Accepted" },
268 { ResponseCodes::nonAuthoritativeInformation,
"Non-Authoritative Information" },
269 { ResponseCodes::noContent,
"No Content" },
270 { ResponseCodes::resetContent,
"Reset Content" },
271 { ResponseCodes::partialContent,
"Partial Content" },
272 { ResponseCodes::multiStatus,
"Multi-Status" },
273 { ResponseCodes::alreadyReported,
"Already Reported" },
274 { ResponseCodes::IMUsed,
"IM Used" },
275 { ResponseCodes::multipleChoices,
"Multiple Choices" },
276 { ResponseCodes::movedPermanently,
"Moved Permanently" },
277 { ResponseCodes::found,
"Found" },
278 { ResponseCodes::seeOther,
"See Other" },
279 { ResponseCodes::notModified,
"Not Modified" },
280 { ResponseCodes::useProxy,
"Use Proxy" },
281 { ResponseCodes::temporaryRedirect,
"Temporary Redirect" },
282 { ResponseCodes::permanentRedirect,
"Permanent Redirect" },
283 { ResponseCodes::badRequest,
"Bad Request" },
284 { ResponseCodes::unauthorized,
"Unauthorized" },
285 { ResponseCodes::paymentRequired,
"Payment Required" },
286 { ResponseCodes::forbidden,
"Forbidden" },
287 { ResponseCodes::notFound,
"Not Found" },
288 { ResponseCodes::methodNotAllowed,
"Method Not Allowed" },
289 { ResponseCodes::notAcceptable,
"Not Acceptable" },
290 { ResponseCodes::proxyAuthenticationRequired,
"Proxy Authentication Required" },
291 { ResponseCodes::requestTimeout,
"Request Timeout" },
292 { ResponseCodes::conflict,
"Conflict" },
293 { ResponseCodes::gone,
"Gone" },
294 { ResponseCodes::lengthRequired,
"Length Required" },
295 { ResponseCodes::preconditionFailed,
"Precondition Failed" },
296 { ResponseCodes::payloadTooLarge,
"Payload Too Large" },
297 { ResponseCodes::URITooLong,
"URI Tool Long" },
298 { ResponseCodes::unsupportedMediaType,
"Unsupported Media Type" },
299 { ResponseCodes::rangeNotSatisfiable,
"Range Not Satisfiable" },
300 { ResponseCodes::expectationFailed,
"Expectation Failed" },
301 { ResponseCodes::iamATeapot,
"I am teapot" },
302 { ResponseCodes::authenticationTimeout,
"Authentication Timeout" },
303 { ResponseCodes::misdirectedRequest,
"Misdirected Request" },
304 { ResponseCodes::unprocessableEntity,
"Unprocessable Entity" },
305 { ResponseCodes::locked,
"Locked" },
306 { ResponseCodes::failedDependency,
"Failed Dependency" },
307 { ResponseCodes::upgradeRequired,
"Upgrade Required" },
308 { ResponseCodes::preconditionRequired,
"Precondition Required" },
309 { ResponseCodes::tooManyRequests,
"Too Many Requests" },
310 { ResponseCodes::requestHeaderFieldsTooLarge,
"Request Header Fields Too Large" },
311 { ResponseCodes::retryWith,
"Retry With" },
312 { ResponseCodes::unavailableForLegalReasons,
"Unavailable For Legal Reasons" },
313 { ResponseCodes::clientClosedRequest,
"Client Closed Request" },
314 { ResponseCodes::internalServerError,
"Internal Server Error" },
315 { ResponseCodes::notImplemented,
"Not Implemented" },
316 { ResponseCodes::badGateway,
"Bad Gateway" },
317 { ResponseCodes::serviceUnavailable,
"Service Unavailable" },
318 { ResponseCodes::gatewayTimeout,
"Gateway Timeout" },
319 { ResponseCodes::HTTPVersionNotSupported,
"HTTP Version Not Supported" },
320 { ResponseCodes::variantAlsoNegotiates,
"Variant Also Negotiates" },
321 { ResponseCodes::insufficientStorage,
"Insufficient Storage" },
322 { ResponseCodes::loopDetected,
"Loop Detected" },
323 { ResponseCodes::bandwidthLimitExceeded,
"Bandwidth Limit Exceeded" },
324 { ResponseCodes::notExtended,
"Not Extended" },
325 { ResponseCodes::networkAuthenticationRequired,
"Network Authentication Required" },
326 { ResponseCodes::unknownError,
"Unknown Error" },
327 { ResponseCodes::webServerIsDown,
"Web Server Is Down" },
328 { ResponseCodes::connectionTimedOut,
"Connection Timed Out" },
329 { ResponseCodes::originIsUnreachable,
"Origin Is Unreachable" },
330 { ResponseCodes::aTimeoutOccurred,
"A Timeout Occurred" },
331 { ResponseCodes::SSLHandshakeFailed,
"SSL Handshake Failed" },
332 { ResponseCodes::invalidSSLCertificate,
"Invalid SSL Certificate" }
335 if (
auto it = responseMessage.find(
static_cast<ResponseCodes
>(code)); it != responseMessage.end())
340 return "Unknown response code";