Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseluisq/33fa1a662e38dfc958df to your computer and use it in GitHub Desktop.
Save joseluisq/33fa1a662e38dfc958df to your computer and use it in GitHub Desktop.
Javascript Hash of Common HTTP Status
var HTTPStatusService = {
ok: {
code: 200,
msg: 'The request sent by the client was successful.'
},
bad_request: {
code: 400,
msg: 'The syntax of the request was not understood by the server.'
},
no_authorized: {
code: 401,
msg: 'The request needs user authentication.'
},
forbidden: {
code: 403,
msg: 'The server has refused to fulfill the request.'
},
not_found: {
code: 404,
msg: 'The document/file requested by the client was not found.'
},
request_timeout: {
code: 408,
msg: 'The client failed to sent a request in the time allowed by the server.'
},
error: {
code: 500,
msg: 'The request was unsuccessful due to an unexpected condition encountered by the server.'
},
service_unavailable: {
code: 503,
msg: 'The request was unsuccessful to the server being down or overloaded.'
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment