HttpStatusDescription.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. namespace SocketHttpListener.Net
  2. {
  3. internal static class HttpStatusDescription
  4. {
  5. internal static string Get(HttpStatusCode code)
  6. {
  7. return Get((int)code);
  8. }
  9. internal static string Get(int code)
  10. {
  11. switch (code)
  12. {
  13. case 100: return "Continue";
  14. case 101: return "Switching Protocols";
  15. case 102: return "Processing";
  16. case 200: return "OK";
  17. case 201: return "Created";
  18. case 202: return "Accepted";
  19. case 203: return "Non-Authoritative Information";
  20. case 204: return "No Content";
  21. case 205: return "Reset Content";
  22. case 206: return "Partial Content";
  23. case 207: return "Multi-Status";
  24. case 300: return "Multiple Choices";
  25. case 301: return "Moved Permanently";
  26. case 302: return "Found";
  27. case 303: return "See Other";
  28. case 304: return "Not Modified";
  29. case 305: return "Use Proxy";
  30. case 307: return "Temporary Redirect";
  31. case 400: return "Bad Request";
  32. case 401: return "Unauthorized";
  33. case 402: return "Payment Required";
  34. case 403: return "Forbidden";
  35. case 404: return "Not Found";
  36. case 405: return "Method Not Allowed";
  37. case 406: return "Not Acceptable";
  38. case 407: return "Proxy Authentication Required";
  39. case 408: return "Request Timeout";
  40. case 409: return "Conflict";
  41. case 410: return "Gone";
  42. case 411: return "Length Required";
  43. case 412: return "Precondition Failed";
  44. case 413: return "Request Entity Too Large";
  45. case 414: return "Request-Uri Too Long";
  46. case 415: return "Unsupported Media Type";
  47. case 416: return "Requested Range Not Satisfiable";
  48. case 417: return "Expectation Failed";
  49. case 422: return "Unprocessable Entity";
  50. case 423: return "Locked";
  51. case 424: return "Failed Dependency";
  52. case 426: return "Upgrade Required"; // RFC 2817
  53. case 500: return "Internal Server Error";
  54. case 501: return "Not Implemented";
  55. case 502: return "Bad Gateway";
  56. case 503: return "Service Unavailable";
  57. case 504: return "Gateway Timeout";
  58. case 505: return "Http Version Not Supported";
  59. case 507: return "Insufficient Storage";
  60. }
  61. return null;
  62. }
  63. }
  64. }