httpstatusname.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 2016 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview Names for HTTP status codes
  16. */
  17. goog.provide('goog.net.HttpStatusName');
  18. /**
  19. * HTTP Status Code Names defined in RFC 2616 and RFC 6585.
  20. * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  21. * @see http://tools.ietf.org/html/rfc6585
  22. * @type {!Object<number, string>}
  23. */
  24. goog.net.HttpStatusName = {
  25. // Informational 1xx
  26. 100: 'Continue',
  27. 101: 'Switching Protocols',
  28. // Successful 2xx
  29. 200: 'OK',
  30. 201: 'Created',
  31. 202: 'Accepted',
  32. 203: 'Non-Authoritative Information',
  33. 204: 'No Content',
  34. 205: 'Reset Content',
  35. 206: 'Partial Content',
  36. // Redirection 3xx
  37. 300: 'Multiple Choices',
  38. 301: 'Moved Permanently',
  39. 302: 'Found',
  40. 303: 'See Other',
  41. 304: 'Not Modified',
  42. 305: 'Use Proxy',
  43. 307: 'Temporary Redirect',
  44. // Client Error 4xx
  45. 400: 'Bad Request',
  46. 401: 'Unauthorized',
  47. 402: 'Payment Required',
  48. 403: 'Forbidden',
  49. 404: 'Not Found',
  50. 405: 'Method Not Allowed',
  51. 406: 'Not Acceptable',
  52. 407: 'Proxy Authentication Required',
  53. 408: 'Request Timeout',
  54. 409: 'Conflict',
  55. 410: 'Gone',
  56. 411: 'Length Required',
  57. 412: 'Precondition Failed',
  58. 413: 'Request Entity Too Large',
  59. 414: 'Request-URI Too Long',
  60. 415: 'Unsupported Media Type',
  61. 416: 'Requested Range Not Satisfiable',
  62. 417: 'Expectation Failed',
  63. 428: 'Precondition Required',
  64. 429: 'Too Many Requests',
  65. 431: 'Request Header Fields Too Large',
  66. // Server Error 5xx
  67. 500: 'Internal Server Error',
  68. 501: 'Not Implemented',
  69. 502: 'Bad Gateway',
  70. 503: 'Service Unavailable',
  71. 504: 'Gateway Timeout',
  72. 505: 'HTTP Version Not Supported',
  73. 511: 'Network Authentication Required'
  74. };