{"id":15026112,"url":"https://github.com/narrowspark/http-status","last_synced_at":"2025-10-03T23:32:23.138Z","repository":{"id":52417021,"uuid":"60158544","full_name":"narrowspark/http-status","owner":"narrowspark","description":":information_source: A package for working with HTTP statuses.","archived":true,"fork":false,"pushed_at":"2022-06-26T08:30:39.000Z","size":128,"stargazers_count":9,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T04:06:33.556Z","etag":null,"topics":["http","http-status-code","php72","psr-7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narrowspark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-01T08:20:32.000Z","updated_at":"2023-03-01T10:38:42.000Z","dependencies_parsed_at":"2022-08-23T14:20:56.372Z","dependency_job_id":null,"html_url":"https://github.com/narrowspark/http-status","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fhttp-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fhttp-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fhttp-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fhttp-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narrowspark","download_url":"https://codeload.github.com/narrowspark/http-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235204448,"owners_count":18952326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","http-status-code","php72","psr-7"],"created_at":"2024-09-24T20:03:49.005Z","updated_at":"2025-10-03T23:32:22.838Z","avatar_url":"https://github.com/narrowspark.png","language":"PHP","readme":"\u003ch2 align=\"center\"\u003eHttp Status\u003c/h2\u003e\n\u003ch3 align=\"center\"\u003eA package for working with HTTP statuses.\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/narrowspark/http-status/releases\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/narrowspark/http-status.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://php.net/\"\u003e\u003cimg src=\"https://img.shields.io/badge/php-%5E7.2.0-8892BF.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/narrowspark/http-status\"\u003e\u003cimg src=\"https://img.shields.io/travis/narrowspark/http-status/master.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/narrowspark/http-status\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/narrowspark/http-status/master.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/narrowspark/http-status\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/narrowspark/http-status.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"http://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nInstallation\n------------\n\nVia Composer\n\n```bash\n$ composer require narrowspark/http-status\n```\n\nUse\n------------\n\n``` php\nuse Narrowspark\\HttpStatus\\Contract\\Exception\\HttpException as HttpExceptionContract;\nuse Narrowspark\\HttpStatus\\HttpStatus;\n\n// get status message from code\necho HttpStatus::getReasonMessage(301); // This and all future requests should be directed to the given URI.\n\ntry {\n    HttpStatus::getReasonException(301):\n} catch(HttpExceptionContract $e) {\n    echo $e-\u003egetMessage(); // 301 Moved Permanently\n    echo $e-\u003egetStatusCode(); // 301\n}\n```\n\n### Now we have support for ([http-message-util](//github.com/php-fig/http-message-util)) so you can do something like this:\n\n``` php\nuse Narrowspark\\HttpStatus\\HttpStatus;\n\n// get status name from code\necho HttpStatus::getReasonPhrase(HttpStatus::STATUS_MOVED_PERMANENTLY); // Moved Permanently\n```\n\n## HTTP status code classes ([from RFC7231](//tools.ietf.org/html/rfc7231#section-6))\nThe first digit of the status-code defines the class of response.\nThe last two digits do not have any categorization role. There are five values for the first digit:\n\nDigit  |  Category  |  Meaning\n------------- | -------------  | -------------\n1xx | Informational | The request was received, continuing process\n2xx | Successful | The request was successfully received, understood, and accepted\n3xx | Redirection | Further action needs to be taken in order to complete the request\n4xx | Client Error | The request contains bad syntax or cannot be fulfilled\n5xx | Server Error | The server failed to fulfill an apparently valid request\n\n\n## Available HTTP status codes\nCode  |  Message  |  RFC\n------------- | ------------- | -------------\n100 | Continue | [RFC7231, Section 6.2.1]\n101 | Switching Protocols | [RFC7231, Section 6.2.2]\n102 | Processing | [RFC2518]\n103 | Http Early Hints | [RFC8297]\n104-199 | *Unassigned* |\n200 | OK | [RFC7231, Section 6.3.1]\n201 | Created | [RFC7231, Section 6.3.2]\n202 | Accepted | [RFC7231, Section 6.3.3]\n203 | Non-Authoritative Information | [RFC7231, Section 6.3.4]\n204 | No Content | [RFC7231, Section 6.3.5]\n205 | Reset Content | [RFC7231, Section 6.3.6]\n206 | Partial Content | [RFC7233, Section 4.1]\n207 | Multi-Status | [RFC4918]\n208 | Already Reported | [RFC5842]\n209-225 | *Unassigned* |\n226 | IM Used | [RFC3229]\n227-299 | *Unassigned* |\n300 | Multiple Choices | [RFC7231, Section 6.4.1]\n301 | Moved Permanently | [RFC7231, Section 6.4.2]\n302 | Found | [RFC7231, Section 6.4.3]\n303 | See Other | [RFC7231, Section 6.4.4]\n304 | Not Modified | [RFC7232, Section 4.1]\n305 | Use Proxy | [RFC7231, Section 6.4.5]\n306 | (Unused) | [RFC7231, Section 6.4.6]\n307 | Temporary Redirect | [RFC7231, Section 6.4.7]\n308 | Permanent Redirect | [RFC7538]\n309-399 | *Unassigned* |\n400 | Bad Request | [RFC7231, Section 6.5.1]\n401 | Unauthorized | [RFC7235, Section 3.1]\n402 | Payment Required | [RFC7231, Section 6.5.2]\n403 | Forbidden | [RFC7231, Section 6.5.3]\n404 | Not Found | [RFC7231, Section 6.5.4]\n405 | Method Not Allowed | [RFC7231, Section 6.5.5]\n406 | Not Acceptable | [RFC7231, Section 6.5.6]\n407 | Proxy Authentication Required | [RFC7235, Section 3.2]\n408 | Request Timeout | [RFC7231, Section 6.5.7]\n409 | Conflict | [RFC7231, Section 6.5.8]\n410 | Gone | [RFC7231, Section 6.5.9]\n411 | Length Required | [RFC7231, Section 6.5.10]\n412 | Precondition Failed | [RFC7232, Section 4.2]\n413 | Payload Too Large | [RFC7231, Section 6.5.11]\n414 | URI Too Long | [RFC7231, Section 6.5.12]\n415 | Unsupported Media Type | [RFC7231, Section 6.5.13]\n416 | Range Not Satisfiable | [RFC7233, Section 4.4]\n417 | Expectation Failed | [RFC7231, Section 6.5.14]\n418-420 | *Unassigned* |\n421 | Misdirected Request | [RFC7540, Section 9.1.2]\n422 | Unprocessable Entity | [RFC4918]\n423 | Locked | [RFC4918]\n424 | Failed Dependency | [RFC4918]\n425 | Too Early | [RFC-ietf-httpbis-replay-04]\n426 | Upgrade Required | [RFC7231, Section 6.5.15]\n427 | *Unassigned* |\n428 | Precondition Required | [RFC6585]\n429 | Too Many Requests | [RFC6585]\n430 | *Unassigned* |\n431 | Request Header Fields Too Large | [RFC6585]\n432-450 | *Unassigned* |\n451\t| Unavailable For Legal | [RFC7725]\n452-499 | *Unassigned* |\n500 | Internal Server Error | [RFC7231, Section 6.6.1]\n501 | Not Implemented | [RFC7231, Section 6.6.2]\n502 | Bad Gateway | [RFC7231, Section 6.6.3]\n503 | Service Unavailable | [RFC7231, Section 6.6.4]\n504 | Gateway Timeout | [RFC7231, Section 6.6.5]\n505 | HTTP Version Not Supported | [RFC7231, Section 6.6.6]\n506 | Variant Also Negotiates | [RFC2295]\n507 | Insufficient Storage | [RFC4918]\n508 | Loop Detected | [RFC5842]\n509 | *Unassigned* |\n510 | Not Extended | [RFC2774]\n511 | Network Authentication Required | [RFC6585]\n512-599 | *Unassigned* |\n\nChange log\n------------\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\nTesting\n------------\n\n``` bash\n$ vendor/bin/phpunit\n```\n\nContributing\n------------\n\nIf you would like to help take a look at the [list of issues](http://github.com/narrowspark/http-emitter/issues) and check our [Contributing](CONTRIBUTING.md) guild.\n\n\u003e **Note:** Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.\n\n\nLicense\n---------------\n\nThe Narrowspark http-emitter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Fhttp-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarrowspark%2Fhttp-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Fhttp-status/lists"}