PHPackages                             dongzongao/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. dongzongao/http-codes

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

dongzongao/http-codes
=====================

HttpCodes for PHP7.4|PHP 8.0

19PHP

Since Jan 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dongzongao/httpCode)[ Packagist](https://packagist.org/packages/dongzongao/http-codes)[ RSS](/packages/dongzongao-http-codes/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#http-codes)

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

[](#table-of-contents)

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

Usage
=====

[](#usage)

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

```
composer require dongzongao/http-codes

```

```
use Dong;

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'         => 'Dong\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

httpCode
========

[](#httpcode)

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/48058045?v=4)[Dong](/maintainers/dongzongao)[@dongzongao](https://github.com/dongzongao)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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