Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.97 KB | None | 0 0
  1. string code_description(int code)
  2. {
  3.     switch (code) {
  4.         case 100: return "Continue";
  5.         case 101: return "Switching Protocols";
  6.         case 102: return "Processing";
  7.         case 105: return "Name Not Resolved";
  8.  
  9.         case 200: return "OK";
  10.         case 201: return "Created";
  11.         case 202: return "Accepted";
  12.         case 203: return "Non-Authoritative Information";
  13.         case 204: return "No Content";
  14.         case 205: return "Reset Content";
  15.         case 206: return "Partial Content";
  16.         case 207: return "Multi-Status";
  17.         case 226: return "IM Used";
  18.  
  19.         case 300: return "Multiple Choices";
  20.         case 301: return "Moved Permanently";
  21.         case 302: return "Moved Temporarily";
  22.         case 303: return "See Other";
  23.         case 304: return "Not Modified";
  24.         case 305: return "Use Proxy";
  25.         case 307: return "Temporary Redirect";
  26.  
  27.         case 400: return "Bad Request";
  28.         case 401: return "Unauthorized";
  29.         case 402: return "Payment Required";
  30.         case 403: return "Forbidden";
  31.         case 404: return "Not Found";
  32.         case 405: return "Method Not Allowed";
  33.         case 406: return "Not Acceptable";
  34.         case 407: return "Proxy Authentication Required";
  35.         case 408: return "Request Timeout";
  36.         case 409: return "Conflict";
  37.         case 410: return "Gone";
  38.         case 411: return "Length Required";
  39.         case 412: return "Precondition Failed";
  40.         case 413: return "Request Entity Too Large";
  41.         case 414: return "Request-URI Too Large";
  42.         case 415: return "Unsupported Media Type";
  43.         case 416: return "Requested Range Not Satisfiable";
  44.         case 417: return "Expectation Failed";
  45.         case 418: return "I'm a teapot";
  46.         case 422: return "Unprocessable Entity";
  47.         case 423: return "Locked";
  48.         case 424: return "Failed Dependency";
  49.         case 425: return "Unordered Collection";
  50.         case 426: return "Upgrade Required";
  51.         case 428: return "Precondition Required";
  52.         case 429: return "Too Many Requests";
  53.         case 431: return "Request Header Fields Too Large";
  54.         case 434: return "Requested Host Unavailable";
  55.         case 449: return "Retry With";
  56.         case 451: return "Unavailable For Legal Reasons";
  57.         case 456: return "Unrecoverable Error";
  58.  
  59.         case 500: return "Internal Server Error";
  60.         case 501: return "Not Implemented";
  61.         case 502: return "Bad Gateway";
  62.         case 503: return "Service Unavailable";
  63.         case 504: return "Gateway Timeout";
  64.         case 505: return "HTTP Version Not Supported";
  65.         case 506: return "Variant Also Negotiates";
  66.         case 507: return "Insufficient Storage";
  67.         case 508: return "Loop Detected";
  68.         case 509: return "Bandwidth Limit Exceeded";
  69.         case 510: return "Not Extended";
  70.         case 511: return "Network Authentication Required";
  71.  
  72.         default: return "Unknown status code";
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement