Download the PHP package intenave/http-response-status-codes without Composer
On this page you can find all versions of the php package intenave/http-response-status-codes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intenave/http-response-status-codes
More information about intenave/http-response-status-codes
Files in intenave/http-response-status-codes
Package http-response-status-codes
Short Description Package provides an enumeration of standard HTTP status codes along with convenient methods for working with them.
License MIT
Homepage https://github.com/intenave/http-response-status-codes
Informations about the package http-response-status-codes
Http Response Status Code PHP Package
Description
The HttpResponseStatusCode
PHP package is a utility for managing HTTP response status codes. It provides an enumeration of standard HTTP status codes along with convenient methods for working with them.
Features
- Enumerates standard HTTP response status codes with both their names and values.
- Provides methods to retrieve codes, names, and options for HTTP status codes.
- Offers methods to check if a given code is a success (in the 200-299 range).
Installation
You can install this package via Composer:
Usage
Using the HttpResponseStatusCode
package is straightforward. You can access the predefined HTTP status codes, check for success, and retrieve code information as needed.
Getting a Specific Status Code
You can easily obtain a specific HTTP status code using the package:
Checking if a Code is a Success
You can use the isSuccess() method to check if a code is a success (in the 200-299 range):
Retrieving Codes, Names, and Options
You can also retrieve information about the available status codes:
-
To get an array of all status codes (values only):
-
To get an array of all status code names:
- To get an associative array of code names and values:
These methods provide flexibility and ease of use when working with HTTP status codes in your PHP applications.
Contributing
This package is maintained under the Intenave organization. If you'd like to contribute or report issues, please visit the GitHub repository.
License
This package is open-source and available under the MIT License. See the LICENSE file for more information.