Created
May 4, 2016 22:53
-
-
Save alfonsodev/abc82ab5523d6a24ba13d61951e4f7c9 to your computer and use it in GitHub Desktop.
Http status code in a javascript literal object structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Status code list borrowed from https://golang.org/src/net/http/status.go | |
var http: { | |
100: 'CONTINUE' , | |
101: 'SWITCHING_PROTOCOLS' , | |
200: 'OK' , | |
201: 'CREATED' , | |
202: 'ACCEPTED' , | |
203: 'NON_AUTHORITATIVE_INFO' , | |
204: 'NO_CONTENT' , | |
205: 'RESET_CONTENT' , | |
206: 'PARTIAL_CONTENT' , | |
300: 'MULTIPLE_CHOICES' , | |
301: 'MOVED_PERMANENTLY' , | |
302: 'FOUND' , | |
303: 'SEE_OTHER' , | |
304: 'NOT_MODIFIED' , | |
305: 'USE_PROXY' , | |
307: 'TEMPORARY_REDIRECT' , | |
400: 'BAD_REQUEST' , | |
401: 'UNAUTHORIZED' , | |
402: 'PAYMENT_REQUIRED' , | |
403: 'FORBIDDEN' , | |
404: 'NOT_FOUND' , | |
405: 'METHOD_NOT_ALLOWED' , | |
406: 'NOT_ACCEPTABLE' , | |
407: 'PROXY_AUTH_REQUIRED' , | |
408: 'REQUEST_TIMEOUT' , | |
409: 'CONFLICT' , | |
410: 'GONE' , | |
411: 'LENGTH_REQUIRED' , | |
412: 'PRECONDITION_FAILED' , | |
413: 'REQUEST_ENTITY_TOO_LARGE' , | |
414: 'REQUEST_URI_TOO_LONG' , | |
415: 'UNSUPPORTED_MEDIA_TYPE' , | |
416: 'REQUESTED_RANGE_NOT_SATISFIABLE' , | |
417: 'EXPECTATION_FAILED' , | |
418: 'TEAPOT' , | |
428: 'PRECONDITION_REQUIRED' , | |
429: 'TOO_MANY_REQUESTS' , | |
431: 'REQUEST_HEADER_FIELDS_TOO_LARGE' , | |
451: 'UNAVAILABLE_FOR_LEGAL_REASONS' , | |
500: 'INTERNAL_SERVER_ERROR' , | |
501: 'NOT_IMPLEMENTED' , | |
502: 'BAD_GATEWAY' , | |
503: 'SERVICE_UNAVAILABLE' , | |
504: 'GATEWAY_TIMEOUT' , | |
505: 'HTTP_VERSION_NOT_SUPPORTED' , | |
511: 'NETWORK_AUTHENTICATION_REQUIRED' , | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment