PHPackages                             epoch2/http-codes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. epoch2/http-codes

ActiveLibrary[HTTP &amp; Networking](/categories/http)

epoch2/http-codes
=================

Small PHP library for easily accessing HTTP Status Codes.

1.1.1(8y ago)99044[2 PRs](https://github.com/kayex/http-codes/pulls)1MITPHP

Since Jun 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kayex/http-codes)[ Packagist](https://packagist.org/packages/epoch2/http-codes)[ RSS](/packages/epoch2-http-codes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (9)Used By (1)

http-codes
==========

[](#http-codes)

[![Latest Stable Version](https://camo.githubusercontent.com/c91976040bf24f7a097a3cce53f28cb1f5ac059ff50999c030815343f597f244/68747470733a2f2f706f7365722e707567782e6f72672f6b617965782f687474702d636f6465732f762f737461626c65)](https://packagist.org/packages/kayex/http-codes) [![Total Downloads](https://camo.githubusercontent.com/9784109faa615c09cffe8a2c9e1f486602c9a01e27a5c18a09def9c2382c33df/68747470733a2f2f706f7365722e707567782e6f72672f6b617965782f687474702d636f6465732f646f776e6c6f616473)](https://packagist.org/packages/kayex/http-codes) [![License](https://camo.githubusercontent.com/68b4d8a67936943a1638b7ef295b7d75ff49c05718fdd2486a9fa2173015f8b9/68747470733a2f2f706f7365722e707567782e6f72672f6b617965782f687474702d636f6465732f6c6963656e7365)](https://packagist.org/packages/kayex/http-codes)

PHP library for easily accessing HTTP Status codes.

Table of Contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [Optional: Laravel alias](#optional-laravel-alias)
- [Full reference](#full-reference)
- [License](#license)

Installation
============

[](#installation)

Composer

```
composer require kayex/http-codes

```

Usage
=====

[](#usage)

The codes are accessible as `public static` properties on the HttpCodes class

```
use Kayex\HttpCodes;

echo HttpCodes::HTTP_OK; // 200
```

Optional: Laravel alias
=======================

[](#optional-laravel-alias)

Laravel users may want to set up an alias for quick access by adding the following to the alias array in `app/config/app.php`:

```
'HttpCodes'         => 'Kayex\HttpCodes',
```

The codes can then be used like this:

```
use HttpCodes;

echo HttpCodes::HTTP_OK; // 200
```

Full reference
==============

[](#full-reference)

These are all the available status codes and the names they are accessible under.

1xx - Informational
-------------------

[](#1xx---informational)

PropertyCode`HTTP_CONTINUE`100`HTTP_SWITCHING_PROTOCOLS`1012xx - Successful
----------------

[](#2xx---successful)

PropertyCode`HTTP_OK`200`HTTP_CREATED`201`HTTP_ACCEPTED`202`HTTP_NONAUTHORITATIVE_INFORMATION`203`HTTP_NO_CONTENT`204`HTTP_RESET_CONTENT`205`HTTP_PARTIAL_CONTENT`2063xx - Redirect
--------------

[](#3xx---redirect)

PropertyCode`HTTP_MULTIPLE_CHOICES`300`HTTP_MOVED_PERMANENTLY`301`HTTP_FOUND`302`HTTP_SEE_OTHER`303`HTTP_NOT_MODIFIED`304`HTTP_USE_PROXY`305`HTTP_UNUSED`306`HTTP_TEMPORARY_REDIRECT`3074xx - Client Error
------------------

[](#4xx---client-error)

PropertyCode`HTTP_BAD_REQUEST`400`HTTP_UNAUTHORIZED`401`HTTP_PAYMENT_REQUIRED`402`HTTP_FORBIDDEN`403`HTTP_NOT_FOUND`404`HTTP_METHOD_NOT_ALLOWED`405`HTTP_NOT_ACCEPTABLE`406`HTTP_PROXY_AUTHENTICATION_REQUIRED`407`HTTP_REQUEST_TIMEOUT`408`HTTP_CONFLICT`409`HTTP_GONE`410`HTTP_LENGTH_REQUIRED`411`HTTP_PRECONDITION_FAILED`412`HTTP_REQUEST_ENTITY_TOO_LARGE`413`HTTP_REQUEST_URI_TOO_LONG`414`HTTP_UNSUPPORTED_MEDIA_TYPE`415`HTTP_REQUESTED_RANGE_NOT_SATISFIABLE`416`HTTP_EXPECTATION_FAILED`4175xx - Server Error
------------------

[](#5xx---server-error)

PropertyCode`HTTP_INTERNAL_SERVER_ERROR`500`HTTP_NOT_IMPLEMENTED`501`HTTP_BAD_GATEWAY`502`HTTP_SERVICE_UNAVAILABLE`503`HTTP_GATEWAY_TIMEOUT`504`HTTP_VERSION_NOT_SUPPORTED`505License
=======

[](#license)

MIT

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~136 days

Recently: every ~82 days

Total

8

Last Release

3048d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc279a35b6cada519ba3d836534a10152af98c77012ec22326ef0bbbe93b6821?d=identicon)[kayex](/maintainers/kayex)

---

Top Contributors

[![kayex](https://avatars.githubusercontent.com/u/1407203?v=4)](https://github.com/kayex "kayex (4 commits)")

---

Tags

httplaravelphpphp-libraryhttpstatus codehttp status

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/epoch2-http-codes/health.svg)

```
[![Health](https://phpackages.com/badges/epoch2-http-codes/health.svg)](https://phpackages.com/packages/epoch2-http-codes)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[psr/http-client

Common interface for HTTP clients

1.7k680.7M2.1k](/packages/psr-http-client)[psr/link

Common interfaces for HTTP links

2.5k144.1M68](/packages/psr-link)[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M258](/packages/rmccue-requests)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
