http_status.js 865 字节
Newer Older
1 2 3 4
/**
 * exports HTTP status codes
 */

5
const httpStatusCodes = {
6
  ABORTED: 0,
7
  OK: 200,
8 9 10 11 12 13 14 15 16
  CREATED: 201,
  ACCEPTED: 202,
  NON_AUTHORITATIVE_INFORMATION: 203,
  NO_CONTENT: 204,
  RESET_CONTENT: 205,
  PARTIAL_CONTENT: 206,
  MULTI_STATUS: 207,
  ALREADY_REPORTED: 208,
  IM_USED: 226,
17 18
  MULTIPLE_CHOICES: 300,
  BAD_REQUEST: 400,
19
  UNAUTHORIZED: 401,
20
  FORBIDDEN: 403,
L
Lin Jen-Shin 已提交
21
  NOT_FOUND: 404,
22
  CONFLICT: 409,
23
  GONE: 410,
24
  UNPROCESSABLE_ENTITY: 422,
25
  SERVICE_UNAVAILABLE: 503,
26
};
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

export const successCodes = [
  httpStatusCodes.OK,
  httpStatusCodes.CREATED,
  httpStatusCodes.ACCEPTED,
  httpStatusCodes.NON_AUTHORITATIVE_INFORMATION,
  httpStatusCodes.NO_CONTENT,
  httpStatusCodes.RESET_CONTENT,
  httpStatusCodes.PARTIAL_CONTENT,
  httpStatusCodes.MULTI_STATUS,
  httpStatusCodes.ALREADY_REPORTED,
  httpStatusCodes.IM_USED,
];

export default httpStatusCodes;