MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / HTTPCodeToStatus

Function HTTPCodeToStatus

libi2pd/HTTP.cpp:517–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515 }
516
517 std::string_view HTTPCodeToStatus(int code)
518 {
519 std::string_view ptr;
520 switch (code)
521 {
522 case 105: ptr = "Name Not Resolved"; break;
523 /* success */
524 case 200: ptr = "OK"; break;
525 case 206: ptr = "Partial Content"; break;
526 /* redirect */
527 case 301: ptr = "Moved Permanently"; break;
528 case 302: ptr = "Found"; break;
529 case 304: ptr = "Not Modified"; break;
530 case 307: ptr = "Temporary Redirect"; break;
531 /* client error */
532 case 400: ptr = "Bad Request"; break;
533 case 401: ptr = "Unauthorized"; break;
534 case 403: ptr = "Forbidden"; break;
535 case 404: ptr = "Not Found"; break;
536 case 407: ptr = "Proxy Authentication Required"; break;
537 case 408: ptr = "Request Timeout"; break;
538 /* server error */
539 case 500: ptr = "Internal Server Error"; break;
540 case 502: ptr = "Bad Gateway"; break;
541 case 503: ptr = "Not Implemented"; break;
542 case 504: ptr = "Gateway Timeout"; break;
543 default: ptr = "Unknown Status"; break;
544 }
545 return ptr;
546 }
547
548 std::string UrlDecode(std::string_view url, bool allow_null)
549 {

Callers 1

to_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected