ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago (distributed domain, exempt) |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://github.com/prettymuchbryce/http-status-codes |
| Last Crawled | 2026-04-13 02:43:06 (7 hours ago) |
| First Indexed | 2019-04-28 13:35:37 (6 years ago) |
| HTTP Status Code | 200 |
| Meta Title | GitHub - prettymuchbryce/http-status-codes: Constants enumerating the HTTP status codes. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported. · GitHub |
| Meta Description | Constants enumerating the HTTP status codes. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported. - prettymuchbryce/http-status-codes |
| Meta Canonical | null |
| Boilerpipe Text | Constants enumerating the HTTP status codes. Based on the
Java Apache HttpStatus API
.
All status codes defined in the following RFCs are supported:
RFC1945 (HTTP/1.0)
RFC2616 (HTTP/1.1)
RFC7231 (HTTP/1.1: Semantics and Content)
RFC2518 (WebDAV)
RFC6585 (Additional HTTP Status Codes)
RFC7538 (Permanent Redirect)
RFC8297 (An HTTP Status Code for Indicating Hints)
TypeScript or JavaScript. Completely library agnostic. No dependencies.
Installation
npm install http-status-codes --save
Usage (express 4.x)
import
{
ReasonPhrases
,
StatusCodes
,
getReasonPhrase
,
getStatusCode
,
}
from
'http-status-codes'
;
response
.
status
(
StatusCodes
.
OK
)
.
send
(
ReasonPhrases
.
OK
)
;
response
.
status
(
StatusCodes
.
INTERNAL_SERVER_ERROR
)
.
send
(
{
error
:
getReasonPhrase
(
StatusCodes
.
INTERNAL_SERVER_ERROR
)
}
)
;
response
.
status
(
getStatusCode
(
'Internal Server Error'
)
)
.
send
(
{
error
:
'Internal Server Error'
}
)
;
Codes
Code
Constant
Reason Phrase
100
CONTINUE
Continue
101
SWITCHING_PROTOCOLS
Switching Protocols
102
PROCESSING
Processing
103
EARLY_HINTS
Early Hints
200
OK
OK
201
CREATED
Created
202
ACCEPTED
Accepted
203
NON_AUTHORITATIVE_INFORMATION
Non Authoritative Information
204
NO_CONTENT
No Content
205
RESET_CONTENT
Reset Content
206
PARTIAL_CONTENT
Partial Content
207
MULTI_STATUS
Multi-Status
300
MULTIPLE_CHOICES
Multiple Choices
301
MOVED_PERMANENTLY
Moved Permanently
302
MOVED_TEMPORARILY
Moved Temporarily
303
SEE_OTHER
See Other
304
NOT_MODIFIED
Not Modified
305
USE_PROXY
Use Proxy
307
TEMPORARY_REDIRECT
Temporary Redirect
308
PERMANENT_REDIRECT
Permanent Redirect
400
BAD_REQUEST
Bad Request
401
UNAUTHORIZED
Unauthorized
402
PAYMENT_REQUIRED
Payment Required
403
FORBIDDEN
Forbidden
404
NOT_FOUND
Not Found
405
METHOD_NOT_ALLOWED
Method Not Allowed
406
NOT_ACCEPTABLE
Not Acceptable
407
PROXY_AUTHENTICATION_REQUIRED
Proxy Authentication Required
408
REQUEST_TIMEOUT
Request Timeout
409
CONFLICT
Conflict
410
GONE
Gone
411
LENGTH_REQUIRED
Length Required
412
PRECONDITION_FAILED
Precondition Failed
413
REQUEST_TOO_LONG
Request Entity Too Large
414
REQUEST_URI_TOO_LONG
Request-URI Too Long
415
UNSUPPORTED_MEDIA_TYPE
Unsupported Media Type
416
REQUESTED_RANGE_NOT_SATISFIABLE
Requested Range Not Satisfiable
417
EXPECTATION_FAILED
Expectation Failed
418
IM_A_TEAPOT
I'm a teapot
419
INSUFFICIENT_SPACE_ON_RESOURCE
Insufficient Space on Resource
420
METHOD_FAILURE
Method Failure
421
MISDIRECTED_REQUEST
Misdirected Request
422
UNPROCESSABLE_ENTITY
Unprocessable Entity
423
LOCKED
Locked
424
FAILED_DEPENDENCY
Failed Dependency
426
UPGRADE_REQUIRED
Upgrade Required
428
PRECONDITION_REQUIRED
Precondition Required
429
TOO_MANY_REQUESTS
Too Many Requests
431
REQUEST_HEADER_FIELDS_TOO_LARGE
Request Header Fields Too Large
451
UNAVAILABLE_FOR_LEGAL_REASONS
Unavailable For Legal Reasons
500
INTERNAL_SERVER_ERROR
Internal Server Error
501
NOT_IMPLEMENTED
Not Implemented
502
BAD_GATEWAY
Bad Gateway
503
SERVICE_UNAVAILABLE
Service Unavailable
504
GATEWAY_TIMEOUT
Gateway Timeout
505
HTTP_VERSION_NOT_SUPPORTED
HTTP Version Not Supported
507
INSUFFICIENT_STORAGE
Insufficient Storage
511
NETWORK_AUTHENTICATION_REQUIRED
Network Authentication Required
Migrating from v1.x.x
http-status-codes v2 is mostly backwards compatible with v1. There is a single breaking change and two recommended changes.
[Breaking Change] 'Server Error'
The reason phrase for the status code
500
has been changed from
"Server Error"
to
"Internal Server Error"
. This is the correct phrase according to RFC7231. If you are migrating from v1, and have code that relies on the result of
getStatusText(500)
or
getReasonPhrase('Server Error')
, then this could affect you.
[Non-breaking change] getStatusText renamed getReasonPhrase
The function
getStatusText
has been renamed to
getReasonPhrase
. The old function is still available, but may be deprecated in a future version. To fix this simply rename instances of
getStatusText()
to
getReasonPhrase()
. The function is otherwise the same as it was before.
[Non-breaking change] StatusCodes
In http-status-codes v1, Status Codes were exported directly from the top-level module. i.e.
HttpStatus.OK
. In v2 all Status Codes live under an object called
StatusCodes
. i.e.
HttpStatus.StatusCodes.OK
. We made this change to cater to TypeScript users who prefer a dedicated value with an enum type. The previous values are still exported, but we won't continue to update them. Please migrate if you're using the old-style imports.
Proposing a new status code
If you'd like to propose a new status code, feel free to update "codes.json" with the necessary
information and open a pull request. There is no need to modify source code or even this README.
This is done automatically by
npm run update-codes
.
In general, we try to include only codes that have an official RFC and have been approved, however
exceptions can be made if the code is already in widespread use in the wild.
Steps to build and publish
npm run update-codes
npm run
test
npm run build
npm version [major
|
minor
|
patch]
npm publish
After releasing, please add release notes via GitHub Releases. |
| Markdown | [Skip to content](https://github.com/prettymuchbryce/http-status-codes#start-of-content)
## Navigation Menu
Toggle navigation
[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprettymuchbryce%2Fhttp-status-codes)
Appearance settings
- Platform
- AI CODE CREATION
- [GitHub CopilotWrite better code with AI](https://github.com/features/copilot)
- [GitHub SparkBuild and deploy intelligent apps](https://github.com/features/spark)
- [GitHub ModelsManage and compare prompts](https://github.com/features/models)
- [MCP RegistryNewIntegrate external tools](https://github.com/mcp)
- DEVELOPER WORKFLOWS
- [ActionsAutomate any workflow](https://github.com/features/actions)
- [CodespacesInstant dev environments](https://github.com/features/codespaces)
- [IssuesPlan and track work](https://github.com/features/issues)
- [Code ReviewManage code changes](https://github.com/features/code-review)
- APPLICATION SECURITY
- [GitHub Advanced SecurityFind and fix vulnerabilities](https://github.com/security/advanced-security)
- [Code securitySecure your code as you build](https://github.com/security/advanced-security/code-security)
- [Secret protectionStop leaks before they start](https://github.com/security/advanced-security/secret-protection)
- EXPLORE
- [Why GitHub](https://github.com/why-github)
- [Documentation](https://docs.github.com/)
- [Blog](https://github.blog/)
- [Changelog](https://github.blog/changelog)
- [Marketplace](https://github.com/marketplace)
[View all features](https://github.com/features)
- Solutions
- BY COMPANY SIZE
- [Enterprises](https://github.com/enterprise)
- [Small and medium teams](https://github.com/team)
- [Startups](https://github.com/enterprise/startups)
- [Nonprofits](https://github.com/solutions/industry/nonprofits)
- BY USE CASE
- [App Modernization](https://github.com/solutions/use-case/app-modernization)
- [DevSecOps](https://github.com/solutions/use-case/devsecops)
- [DevOps](https://github.com/solutions/use-case/devops)
- [CI/CD](https://github.com/solutions/use-case/ci-cd)
- [View all use cases](https://github.com/solutions/use-case)
- BY INDUSTRY
- [Healthcare](https://github.com/solutions/industry/healthcare)
- [Financial services](https://github.com/solutions/industry/financial-services)
- [Manufacturing](https://github.com/solutions/industry/manufacturing)
- [Government](https://github.com/solutions/industry/government)
- [View all industries](https://github.com/solutions/industry)
[View all solutions](https://github.com/solutions)
- Resources
- EXPLORE BY TOPIC
- [AI](https://github.com/resources/articles?topic=ai)
- [Software Development](https://github.com/resources/articles?topic=software-development)
- [DevOps](https://github.com/resources/articles?topic=devops)
- [Security](https://github.com/resources/articles?topic=security)
- [View all topics](https://github.com/resources/articles)
- EXPLORE BY TYPE
- [Customer stories](https://github.com/customer-stories)
- [Events & webinars](https://github.com/resources/events)
- [Ebooks & reports](https://github.com/resources/whitepapers)
- [Business insights](https://github.com/solutions/executive-insights)
- [GitHub Skills](https://skills.github.com/)
- SUPPORT & SERVICES
- [Documentation](https://docs.github.com/)
- [Customer support](https://support.github.com/)
- [Community forum](https://github.com/orgs/community/discussions)
- [Trust center](https://github.com/trust-center)
- [Partners](https://github.com/partners)
[View all resources](https://github.com/resources)
- Open Source
- COMMUNITY
- [GitHub SponsorsFund open source developers](https://github.com/sponsors)
- PROGRAMS
- [Security Lab](https://securitylab.github.com/)
- [Maintainer Community](https://maintainers.github.com/)
- [Accelerator](https://github.com/accelerator)
- [GitHub Stars](https://stars.github.com/)
- [Archive Program](https://archiveprogram.github.com/)
- REPOSITORIES
- [Topics](https://github.com/topics)
- [Trending](https://github.com/trending)
- [Collections](https://github.com/collections)
- Enterprise
- ENTERPRISE SOLUTIONS
- [Enterprise platformAI-powered developer platform](https://github.com/enterprise)
- AVAILABLE ADD-ONS
- [GitHub Advanced SecurityEnterprise-grade security features](https://github.com/security/advanced-security)
- [Copilot for BusinessEnterprise-grade AI features](https://github.com/features/copilot/copilot-business)
- [Premium SupportEnterprise-grade 24/7 support](https://github.com/premium-support)
- [Pricing](https://github.com/pricing)
Search or jump to...
# Search code, repositories, users, issues, pull requests...
[Search syntax tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax)
# Provide feedback
Cancel
Submit feedback
# Saved searches
## Use saved searches to filter your results more quickly
Cancel
Create saved search
[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprettymuchbryce%2Fhttp-status-codes)
[Sign up](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=prettymuchbryce%2Fhttp-status-codes)
Appearance settings
Resetting focus
You signed in with another tab or window. [Reload](https://github.com/prettymuchbryce/http-status-codes) to refresh your session. You signed out in another tab or window. [Reload](https://github.com/prettymuchbryce/http-status-codes) to refresh your session. You switched accounts on another tab or window. [Reload](https://github.com/prettymuchbryce/http-status-codes) to refresh your session.
Dismiss alert
[prettymuchbryce](https://github.com/prettymuchbryce) / **[http-status-codes](https://github.com/prettymuchbryce/http-status-codes)** Public
- [Notifications](https://github.com/login?return_to=%2Fprettymuchbryce%2Fhttp-status-codes)
You must be signed in to change notification settings
- [Fork 104](https://github.com/login?return_to=%2Fprettymuchbryce%2Fhttp-status-codes)
- [Star 1.1k](https://github.com/login?return_to=%2Fprettymuchbryce%2Fhttp-status-codes)
- [Code](https://github.com/prettymuchbryce/http-status-codes)
- [Issues 10](https://github.com/prettymuchbryce/http-status-codes/issues)
- [Pull requests 21](https://github.com/prettymuchbryce/http-status-codes/pulls)
- [Actions](https://github.com/prettymuchbryce/http-status-codes/actions)
- [Projects](https://github.com/prettymuchbryce/http-status-codes/projects)
- [Wiki](https://github.com/prettymuchbryce/http-status-codes/wiki)
- [Security and quality 0](https://github.com/prettymuchbryce/http-status-codes/security)
- [Insights](https://github.com/prettymuchbryce/http-status-codes/pulse)
Additional navigation options
- [Code](https://github.com/prettymuchbryce/http-status-codes)
- [Issues](https://github.com/prettymuchbryce/http-status-codes/issues)
- [Pull requests](https://github.com/prettymuchbryce/http-status-codes/pulls)
- [Actions](https://github.com/prettymuchbryce/http-status-codes/actions)
- [Projects](https://github.com/prettymuchbryce/http-status-codes/projects)
- [Wiki](https://github.com/prettymuchbryce/http-status-codes/wiki)
- [Security and quality](https://github.com/prettymuchbryce/http-status-codes/security)
- [Insights](https://github.com/prettymuchbryce/http-status-codes/pulse)
# prettymuchbryce/http-status-codes
master
[**16** Branches](https://github.com/prettymuchbryce/http-status-codes/branches)
[**26** Tags](https://github.com/prettymuchbryce/http-status-codes/tags)
Go to file
Code
Open more actions menu
## Folders and files
| Name | Name | Last commit message | Last commit date |
|---|---|---|---|
| Latest commit [](https://github.com/prettymuchbryce)[prettymuchbryce](https://github.com/prettymuchbryce/http-status-codes/commits?author=prettymuchbryce) [Update list of supported RFCs](https://github.com/prettymuchbryce/http-status-codes/commit/c840bc674ab043551b87194d1ebb5415f222abbe) Nov 13, 2023 [c840bc6](https://github.com/prettymuchbryce/http-status-codes/commit/c840bc674ab043551b87194d1ebb5415f222abbe) · Nov 13, 2023 History [81 Commits](https://github.com/prettymuchbryce/http-status-codes/commits/master/) Open commit details 81 Commits | | | |
## Repository files navigation
- [README](https://github.com/prettymuchbryce/http-status-codes)
- [MIT license](https://github.com/prettymuchbryce/http-status-codes)
# http-status-codes
Constants enumerating the HTTP status codes. Based on the [Java Apache HttpStatus API](http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpStatus.html).
All status codes defined in the following RFCs are supported:
- RFC1945 (HTTP/1.0)
- RFC2616 (HTTP/1.1)
- RFC7231 (HTTP/1.1: Semantics and Content)
- RFC2518 (WebDAV)
- RFC6585 (Additional HTTP Status Codes)
- RFC7538 (Permanent Redirect)
- RFC8297 (An HTTP Status Code for Indicating Hints)
TypeScript or JavaScript. Completely library agnostic. No dependencies.
## Installation
```
npm install http-status-codes --save
```
## Usage (express 4.x)
```
import {
ReasonPhrases,
StatusCodes,
getReasonPhrase,
getStatusCode,
} from 'http-status-codes';
response
.status(StatusCodes.OK)
.send(ReasonPhrases.OK);
response
.status(StatusCodes.INTERNAL_SERVER_ERROR)
.send({
error: getReasonPhrase(StatusCodes.INTERNAL_SERVER_ERROR)
});
response
.status(getStatusCode('Internal Server Error'))
.send({
error: 'Internal Server Error'
});
```
## Codes
| Code | Constant | Reason Phrase |
|---|---|---|
| 100 | CONTINUE | Continue |
| 101 | SWITCHING\_PROTOCOLS | Switching Protocols |
| 102 | PROCESSING | Processing |
| 103 | EARLY\_HINTS | Early Hints |
| 200 | OK | OK |
| 201 | CREATED | Created |
| 202 | ACCEPTED | Accepted |
| 203 | NON\_AUTHORITATIVE\_INFORMATION | Non Authoritative Information |
| 204 | NO\_CONTENT | No Content |
| 205 | RESET\_CONTENT | Reset Content |
| 206 | PARTIAL\_CONTENT | Partial Content |
| 207 | MULTI\_STATUS | Multi-Status |
| 300 | MULTIPLE\_CHOICES | Multiple Choices |
| 301 | MOVED\_PERMANENTLY | Moved Permanently |
| 302 | MOVED\_TEMPORARILY | Moved Temporarily |
| 303 | SEE\_OTHER | See Other |
| 304 | NOT\_MODIFIED | Not Modified |
| 305 | USE\_PROXY | Use Proxy |
| 307 | TEMPORARY\_REDIRECT | Temporary Redirect |
| 308 | PERMANENT\_REDIRECT | Permanent Redirect |
| 400 | BAD\_REQUEST | Bad Request |
| 401 | UNAUTHORIZED | Unauthorized |
| 402 | PAYMENT\_REQUIRED | Payment Required |
| 403 | FORBIDDEN | Forbidden |
| 404 | NOT\_FOUND | Not Found |
| 405 | METHOD\_NOT\_ALLOWED | Method Not Allowed |
| 406 | NOT\_ACCEPTABLE | Not Acceptable |
| 407 | PROXY\_AUTHENTICATION\_REQUIRED | Proxy Authentication Required |
| 408 | REQUEST\_TIMEOUT | Request Timeout |
| 409 | CONFLICT | Conflict |
| 410 | GONE | Gone |
| 411 | LENGTH\_REQUIRED | Length Required |
| 412 | PRECONDITION\_FAILED | Precondition Failed |
| 413 | REQUEST\_TOO\_LONG | Request Entity Too Large |
| 414 | REQUEST\_URI\_TOO\_LONG | Request-URI Too Long |
| 415 | UNSUPPORTED\_MEDIA\_TYPE | Unsupported Media Type |
| 416 | REQUESTED\_RANGE\_NOT\_SATISFIABLE | Requested Range Not Satisfiable |
| 417 | EXPECTATION\_FAILED | Expectation Failed |
| 418 | IM\_A\_TEAPOT | I'm a teapot |
| 419 | INSUFFICIENT\_SPACE\_ON\_RESOURCE | Insufficient Space on Resource |
| 420 | METHOD\_FAILURE | Method Failure |
| 421 | MISDIRECTED\_REQUEST | Misdirected Request |
| 422 | UNPROCESSABLE\_ENTITY | Unprocessable Entity |
| 423 | LOCKED | Locked |
| 424 | FAILED\_DEPENDENCY | Failed Dependency |
| 426 | UPGRADE\_REQUIRED | Upgrade Required |
| 428 | PRECONDITION\_REQUIRED | Precondition Required |
| 429 | TOO\_MANY\_REQUESTS | Too Many Requests |
| 431 | REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | Request Header Fields Too Large |
| 451 | UNAVAILABLE\_FOR\_LEGAL\_REASONS | Unavailable For Legal Reasons |
| 500 | INTERNAL\_SERVER\_ERROR | Internal Server Error |
| 501 | NOT\_IMPLEMENTED | Not Implemented |
| 502 | BAD\_GATEWAY | Bad Gateway |
| 503 | SERVICE\_UNAVAILABLE | Service Unavailable |
| 504 | GATEWAY\_TIMEOUT | Gateway Timeout |
| 505 | HTTP\_VERSION\_NOT\_SUPPORTED | HTTP Version Not Supported |
| 507 | INSUFFICIENT\_STORAGE | Insufficient Storage |
| 511 | NETWORK\_AUTHENTICATION\_REQUIRED | Network Authentication Required |
## Migrating from v1.x.x
http-status-codes v2 is mostly backwards compatible with v1. There is a single breaking change and two recommended changes.
#### \[Breaking Change\] 'Server Error'
The reason phrase for the status code `500` has been changed from `"Server Error"` to `"Internal Server Error"`. This is the correct phrase according to RFC7231. If you are migrating from v1, and have code that relies on the result of `getStatusText(500)` or `getReasonPhrase('Server Error')`, then this could affect you.
#### \[Non-breaking change\] getStatusText renamed getReasonPhrase
The function `getStatusText` has been renamed to `getReasonPhrase`. The old function is still available, but may be deprecated in a future version. To fix this simply rename instances of `getStatusText()` to `getReasonPhrase()`. The function is otherwise the same as it was before.
#### \[Non-breaking change\] StatusCodes
In http-status-codes v1, Status Codes were exported directly from the top-level module. i.e. `HttpStatus.OK`. In v2 all Status Codes live under an object called `StatusCodes`. i.e. `HttpStatus.StatusCodes.OK`. We made this change to cater to TypeScript users who prefer a dedicated value with an enum type. The previous values are still exported, but we won't continue to update them. Please migrate if you're using the old-style imports.
## Proposing a new status code
If you'd like to propose a new status code, feel free to update "codes.json" with the necessary information and open a pull request. There is no need to modify source code or even this README. This is done automatically by `npm run update-codes`.
In general, we try to include only codes that have an official RFC and have been approved, however exceptions can be made if the code is already in widespread use in the wild.
## Steps to build and publish
```
npm run update-codes
npm run test
npm run build
npm version [major | minor | patch]
npm publish
```
After releasing, please add release notes via GitHub Releases.
## About
Constants enumerating the HTTP status codes. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.
### Resources
[Readme](https://github.com/prettymuchbryce/http-status-codes#readme-ov-file)
### License
[MIT license](https://github.com/prettymuchbryce/http-status-codes#MIT-1-ov-file)
### Uh oh\!
There was an error while loading. [Please reload this page](https://github.com/prettymuchbryce/http-status-codes).
[Activity](https://github.com/prettymuchbryce/http-status-codes/activity)
### Stars
[**1\.1k** stars](https://github.com/prettymuchbryce/http-status-codes/stargazers)
### Watchers
[**5** watching](https://github.com/prettymuchbryce/http-status-codes/watchers)
### Forks
[**104** forks](https://github.com/prettymuchbryce/http-status-codes/forks)
[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fprettymuchbryce%2Fhttp-status-codes&report=prettymuchbryce+%28user%29)
## [Releases 9](https://github.com/prettymuchbryce/http-status-codes/releases)
[http-status-codes 2.3.0 Latest Sep 20, 2023](https://github.com/prettymuchbryce/http-status-codes/releases/tag/v2.3.0)
[\+ 8 releases](https://github.com/prettymuchbryce/http-status-codes/releases)
## [Packages 0](https://github.com/users/prettymuchbryce/packages?repo_name=http-status-codes)
No packages published
## [Used by 168k](https://github.com/prettymuchbryce/http-status-codes/network/dependents)
[        + 168,055](https://github.com/prettymuchbryce/http-status-codes/network/dependents)
## [Contributors](https://github.com/prettymuchbryce/http-status-codes/graphs/contributors)
### Uh oh\!
There was an error while loading. [Please reload this page](https://github.com/prettymuchbryce/http-status-codes).
## Languages
- [TypeScript 92.7%](https://github.com/prettymuchbryce/http-status-codes/search?l=typescript)
- [JavaScript 7.2%](https://github.com/prettymuchbryce/http-status-codes/search?l=javascript)
- [Shell 0.1%](https://github.com/prettymuchbryce/http-status-codes/search?l=shell)
## Footer
© 2026 GitHub, Inc.
### Footer navigation
- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
- [Security](https://github.com/security)
- [Status](https://www.githubstatus.com/)
- [Community](https://github.community/)
- [Docs](https://docs.github.com/)
- [Contact](https://support.github.com/?tags=dotcom-footer)
- Manage cookies
- Do not share my personal information
You can’t perform that action at this time. |
| Readable Markdown | Constants enumerating the HTTP status codes. Based on the [Java Apache HttpStatus API](http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpStatus.html).
All status codes defined in the following RFCs are supported:
- RFC1945 (HTTP/1.0)
- RFC2616 (HTTP/1.1)
- RFC7231 (HTTP/1.1: Semantics and Content)
- RFC2518 (WebDAV)
- RFC6585 (Additional HTTP Status Codes)
- RFC7538 (Permanent Redirect)
- RFC8297 (An HTTP Status Code for Indicating Hints)
TypeScript or JavaScript. Completely library agnostic. No dependencies.
Installation
```
npm install http-status-codes --save
```
Usage (express 4.x)
```
import {
ReasonPhrases,
StatusCodes,
getReasonPhrase,
getStatusCode,
} from 'http-status-codes';
response
.status(StatusCodes.OK)
.send(ReasonPhrases.OK);
response
.status(StatusCodes.INTERNAL_SERVER_ERROR)
.send({
error: getReasonPhrase(StatusCodes.INTERNAL_SERVER_ERROR)
});
response
.status(getStatusCode('Internal Server Error'))
.send({
error: 'Internal Server Error'
});
```
Codes
| Code | Constant | Reason Phrase |
|---|---|---|
| 100 | CONTINUE | Continue |
| 101 | SWITCHING\_PROTOCOLS | Switching Protocols |
| 102 | PROCESSING | Processing |
| 103 | EARLY\_HINTS | Early Hints |
| 200 | OK | OK |
| 201 | CREATED | Created |
| 202 | ACCEPTED | Accepted |
| 203 | NON\_AUTHORITATIVE\_INFORMATION | Non Authoritative Information |
| 204 | NO\_CONTENT | No Content |
| 205 | RESET\_CONTENT | Reset Content |
| 206 | PARTIAL\_CONTENT | Partial Content |
| 207 | MULTI\_STATUS | Multi-Status |
| 300 | MULTIPLE\_CHOICES | Multiple Choices |
| 301 | MOVED\_PERMANENTLY | Moved Permanently |
| 302 | MOVED\_TEMPORARILY | Moved Temporarily |
| 303 | SEE\_OTHER | See Other |
| 304 | NOT\_MODIFIED | Not Modified |
| 305 | USE\_PROXY | Use Proxy |
| 307 | TEMPORARY\_REDIRECT | Temporary Redirect |
| 308 | PERMANENT\_REDIRECT | Permanent Redirect |
| 400 | BAD\_REQUEST | Bad Request |
| 401 | UNAUTHORIZED | Unauthorized |
| 402 | PAYMENT\_REQUIRED | Payment Required |
| 403 | FORBIDDEN | Forbidden |
| 404 | NOT\_FOUND | Not Found |
| 405 | METHOD\_NOT\_ALLOWED | Method Not Allowed |
| 406 | NOT\_ACCEPTABLE | Not Acceptable |
| 407 | PROXY\_AUTHENTICATION\_REQUIRED | Proxy Authentication Required |
| 408 | REQUEST\_TIMEOUT | Request Timeout |
| 409 | CONFLICT | Conflict |
| 410 | GONE | Gone |
| 411 | LENGTH\_REQUIRED | Length Required |
| 412 | PRECONDITION\_FAILED | Precondition Failed |
| 413 | REQUEST\_TOO\_LONG | Request Entity Too Large |
| 414 | REQUEST\_URI\_TOO\_LONG | Request-URI Too Long |
| 415 | UNSUPPORTED\_MEDIA\_TYPE | Unsupported Media Type |
| 416 | REQUESTED\_RANGE\_NOT\_SATISFIABLE | Requested Range Not Satisfiable |
| 417 | EXPECTATION\_FAILED | Expectation Failed |
| 418 | IM\_A\_TEAPOT | I'm a teapot |
| 419 | INSUFFICIENT\_SPACE\_ON\_RESOURCE | Insufficient Space on Resource |
| 420 | METHOD\_FAILURE | Method Failure |
| 421 | MISDIRECTED\_REQUEST | Misdirected Request |
| 422 | UNPROCESSABLE\_ENTITY | Unprocessable Entity |
| 423 | LOCKED | Locked |
| 424 | FAILED\_DEPENDENCY | Failed Dependency |
| 426 | UPGRADE\_REQUIRED | Upgrade Required |
| 428 | PRECONDITION\_REQUIRED | Precondition Required |
| 429 | TOO\_MANY\_REQUESTS | Too Many Requests |
| 431 | REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | Request Header Fields Too Large |
| 451 | UNAVAILABLE\_FOR\_LEGAL\_REASONS | Unavailable For Legal Reasons |
| 500 | INTERNAL\_SERVER\_ERROR | Internal Server Error |
| 501 | NOT\_IMPLEMENTED | Not Implemented |
| 502 | BAD\_GATEWAY | Bad Gateway |
| 503 | SERVICE\_UNAVAILABLE | Service Unavailable |
| 504 | GATEWAY\_TIMEOUT | Gateway Timeout |
| 505 | HTTP\_VERSION\_NOT\_SUPPORTED | HTTP Version Not Supported |
| 507 | INSUFFICIENT\_STORAGE | Insufficient Storage |
| 511 | NETWORK\_AUTHENTICATION\_REQUIRED | Network Authentication Required |
Migrating from v1.x.x
http-status-codes v2 is mostly backwards compatible with v1. There is a single breaking change and two recommended changes.
\[Breaking Change\] 'Server Error'
The reason phrase for the status code `500` has been changed from `"Server Error"` to `"Internal Server Error"`. This is the correct phrase according to RFC7231. If you are migrating from v1, and have code that relies on the result of `getStatusText(500)` or `getReasonPhrase('Server Error')`, then this could affect you.
\[Non-breaking change\] getStatusText renamed getReasonPhrase
The function `getStatusText` has been renamed to `getReasonPhrase`. The old function is still available, but may be deprecated in a future version. To fix this simply rename instances of `getStatusText()` to `getReasonPhrase()`. The function is otherwise the same as it was before.
\[Non-breaking change\] StatusCodes
In http-status-codes v1, Status Codes were exported directly from the top-level module. i.e. `HttpStatus.OK`. In v2 all Status Codes live under an object called `StatusCodes`. i.e. `HttpStatus.StatusCodes.OK`. We made this change to cater to TypeScript users who prefer a dedicated value with an enum type. The previous values are still exported, but we won't continue to update them. Please migrate if you're using the old-style imports.
Proposing a new status code
If you'd like to propose a new status code, feel free to update "codes.json" with the necessary information and open a pull request. There is no need to modify source code or even this README. This is done automatically by `npm run update-codes`.
In general, we try to include only codes that have an official RFC and have been approved, however exceptions can be made if the code is already in widespread use in the wild.
Steps to build and publish
```
npm run update-codes
npm run test
npm run build
npm version [major | minor | patch]
npm publish
```
After releasing, please add release notes via GitHub Releases. |
| Shard | 174 (laksa) |
| Root Hash | 6325672905007345774 |
| Unparsed URL | com,github!/prettymuchbryce/http-status-codes s443 |