Enumeration: HttpStatus
Defined in: packages/core/src/enums/http-status.enum.ts:28
Standard HTTP status codes.
Used to indicate the result of HTTP request processing. Codes are grouped into categories:
- 1xx: Informational
- 2xx: Success
- 3xx: Redirection
- 4xx: Client Error
- 5xx: Server Error
Example
@Get()
findAll() {
return HttpStatus.OK; // 200
}
@Post()
create() {
return HttpStatus.CREATED; // 201
}See
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
Enumeration Members
ACCEPTED
ACCEPTED: 202;Defined in: packages/core/src/enums/http-status.enum.ts:50
The request has been accepted for processing but not yet completed
AMBIGUOUS
AMBIGUOUS: 300;Defined in: packages/core/src/enums/http-status.enum.ts:66
Multiple response options available, client must choose
BAD_GATEWAY
BAD_GATEWAY: 502;Defined in: packages/core/src/enums/http-status.enum.ts:167
Bad response from upstream server
BAD_REQUEST
BAD_REQUEST: 400;Defined in: packages/core/src/enums/http-status.enum.ts:88
The server cannot understand the request due to malformed syntax
CONFLICT
CONFLICT: 409;Defined in: packages/core/src/enums/http-status.enum.ts:115
There is a conflict with the current state of the resource
CONTINUE
CONTINUE: 100;Defined in: packages/core/src/enums/http-status.enum.ts:31
The server has received the initial part of the request and the client may continue sending
CREATED
CREATED: 201;Defined in: packages/core/src/enums/http-status.enum.ts:47
The resource has been created successfully (typically after POST or PUT)
EARLYHINTS
EARLYHINTS: 103;Defined in: packages/core/src/enums/http-status.enum.ts:40
Preliminary response with headers that the client may use
EXPECTATION_FAILED
EXPECTATION_FAILED: 417;Defined in: packages/core/src/enums/http-status.enum.ts:139
The expectation given in the Expect header cannot be met
FAILED_DEPENDENCY
FAILED_DEPENDENCY: 424;Defined in: packages/core/src/enums/http-status.enum.ts:151
Error due to failure of a previous request (WebDAV)
FORBIDDEN
FORBIDDEN: 403;Defined in: packages/core/src/enums/http-status.enum.ts:97
Access is forbidden (no rights to the resource)
FOUND
FOUND: 302;Defined in: packages/core/src/enums/http-status.enum.ts:72
The resource is temporarily available at a different URL
GATEWAY_TIMEOUT
GATEWAY_TIMEOUT: 504;Defined in: packages/core/src/enums/http-status.enum.ts:173
The upstream server did not respond in time
GONE
GONE: 410;Defined in: packages/core/src/enums/http-status.enum.ts:118
The resource has been removed and is no longer available
HTTP_VERSION_NOT_SUPPORTED
HTTP_VERSION_NOT_SUPPORTED: 505;Defined in: packages/core/src/enums/http-status.enum.ts:176
The HTTP version is not supported by the server
I_AM_A_TEAPOT
I_AM_A_TEAPOT: 418;Defined in: packages/core/src/enums/http-status.enum.ts:142
I'm a teapot (Easter Egg from RFC 2324)
INTERNAL_SERVER_ERROR
INTERNAL_SERVER_ERROR: 500;Defined in: packages/core/src/enums/http-status.enum.ts:161
Internal server error
LENGTH_REQUIRED
LENGTH_REQUIRED: 411;Defined in: packages/core/src/enums/http-status.enum.ts:121
Content-Length header is required
METHOD_NOT_ALLOWED
METHOD_NOT_ALLOWED: 405;Defined in: packages/core/src/enums/http-status.enum.ts:103
The HTTP method is not allowed for this resource
MISDIRECTED
MISDIRECTED: 421;Defined in: packages/core/src/enums/http-status.enum.ts:145
The request was directed to a server that cannot produce a response
MOVED_PERMANENTLY
MOVED_PERMANENTLY: 301;Defined in: packages/core/src/enums/http-status.enum.ts:69
The resource has been moved permanently to a new URL
NO_CONTENT
NO_CONTENT: 204;Defined in: packages/core/src/enums/http-status.enum.ts:56
The request succeeded but the response body is empty
NON_AUTHORITATIVE_INFORMATION
NON_AUTHORITATIVE_INFORMATION: 203;Defined in: packages/core/src/enums/http-status.enum.ts:53
The information comes from a third-party source
NOT_ACCEPTABLE
NOT_ACCEPTABLE: 406;Defined in: packages/core/src/enums/http-status.enum.ts:106
The server cannot produce a response in the requested format
NOT_FOUND
NOT_FOUND: 404;Defined in: packages/core/src/enums/http-status.enum.ts:100
The resource could not be found
NOT_IMPLEMENTED
NOT_IMPLEMENTED: 501;Defined in: packages/core/src/enums/http-status.enum.ts:164
The server does not support the functionality required to fulfill the request
NOT_MODIFIED
NOT_MODIFIED: 304;Defined in: packages/core/src/enums/http-status.enum.ts:78
The resource has not changed since the last request (caching)
OK
OK: 200;Defined in: packages/core/src/enums/http-status.enum.ts:44
The request has succeeded
PARTIAL_CONTENT
PARTIAL_CONTENT: 206;Defined in: packages/core/src/enums/http-status.enum.ts:62
The server is returning only part of the resource (for range requests)
PAYLOAD_TOO_LARGE
PAYLOAD_TOO_LARGE: 413;Defined in: packages/core/src/enums/http-status.enum.ts:127
The request payload is too large
PAYMENT_REQUIRED
PAYMENT_REQUIRED: 402;Defined in: packages/core/src/enums/http-status.enum.ts:94
Payment required (reserved for future use)
PERMANENT_REDIRECT
PERMANENT_REDIRECT: 308;Defined in: packages/core/src/enums/http-status.enum.ts:84
The resource has been moved permanently to a new URL (do not change request method)
PRECONDITION_FAILED
PRECONDITION_FAILED: 412;Defined in: packages/core/src/enums/http-status.enum.ts:124
A precondition given in the headers is not met
PRECONDITION_REQUIRED
PRECONDITION_REQUIRED: 428;Defined in: packages/core/src/enums/http-status.enum.ts:154
The server requires conditional headers
PROCESSING
PROCESSING: 102;Defined in: packages/core/src/enums/http-status.enum.ts:37
The server is processing the request but no response is available yet (WebDAV)
PROXY_AUTHENTICATION_REQUIRED
PROXY_AUTHENTICATION_REQUIRED: 407;Defined in: packages/core/src/enums/http-status.enum.ts:109
Authentication through proxy is required
REQUEST_TIMEOUT
REQUEST_TIMEOUT: 408;Defined in: packages/core/src/enums/http-status.enum.ts:112
The server timed out waiting for the request
REQUESTED_RANGE_NOT_SATISFIABLE
REQUESTED_RANGE_NOT_SATISFIABLE: 416;Defined in: packages/core/src/enums/http-status.enum.ts:136
The requested range cannot be returned
RESET_CONTENT
RESET_CONTENT: 205;Defined in: packages/core/src/enums/http-status.enum.ts:59
The client should reset the document (e.g., clear form)
SEE_OTHER
SEE_OTHER: 303;Defined in: packages/core/src/enums/http-status.enum.ts:75
The client should retrieve the resource via GET from another URL
SERVICE_UNAVAILABLE
SERVICE_UNAVAILABLE: 503;Defined in: packages/core/src/enums/http-status.enum.ts:170
The server is temporarily unavailable (overload or maintenance)
SWITCHING_PROTOCOLS
SWITCHING_PROTOCOLS: 101;Defined in: packages/core/src/enums/http-status.enum.ts:34
The server agrees to switch protocols (e.g., to WebSocket)
TEMPORARY_REDIRECT
TEMPORARY_REDIRECT: 307;Defined in: packages/core/src/enums/http-status.enum.ts:81
The resource is temporarily available at a different URL (do not change request method)
TOO_MANY_REQUESTS
TOO_MANY_REQUESTS: 429;Defined in: packages/core/src/enums/http-status.enum.ts:157
Too many requests (rate limiting)
UNAUTHORIZED
UNAUTHORIZED: 401;Defined in: packages/core/src/enums/http-status.enum.ts:91
Authentication is required (not authorized)
UNPROCESSABLE_ENTITY
UNPROCESSABLE_ENTITY: 422;Defined in: packages/core/src/enums/http-status.enum.ts:148
Semantic error in the request (cannot be processed)
UNSUPPORTED_MEDIA_TYPE
UNSUPPORTED_MEDIA_TYPE: 415;Defined in: packages/core/src/enums/http-status.enum.ts:133
The request media format is not supported by the server
URI_TOO_LONG
URI_TOO_LONG: 414;Defined in: packages/core/src/enums/http-status.enum.ts:130
The request URL is too long