Download the PHP package sinemacula/http-primitives-php without Composer
On this page you can find all versions of the php package sinemacula/http-primitives-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sinemacula/http-primitives-php
More information about sinemacula/http-primitives-php
Files in sinemacula/http-primitives-php
Download sinemacula/http-primitives-php
More information about sinemacula/http-primitives-php
Files in sinemacula/http-primitives-php
Vendor sinemacula
Package http-primitives-php
Short Description Standalone, framework-agnostic PHP 8.3+ package providing typed backed enums for HTTP protocol primitives with zero runtime dependencies.
License Apache-2.0
Package http-primitives-php
Short Description Standalone, framework-agnostic PHP 8.3+ package providing typed backed enums for HTTP protocol primitives with zero runtime dependencies.
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package http-primitives-php
HTTP Primitives
Standalone, framework-agnostic PHP 8.3+ package providing typed backed enums for HTTP protocol primitives. Zero runtime dependencies.
Enums
| Enum | Backing Type | Cases | Description |
|---|---|---|---|
HttpStatus |
int |
63 | All standard HTTP status codes (1xx-5xx) |
HttpMethod |
string |
9 | HTTP request methods per RFC 9110 |
MediaType |
string |
43 | Common MIME types across 7 categories |
HttpHeader |
string |
61 | Standard and non-standard HTTP headers |
CacheDirective |
string |
16 | Cache-Control directive values |
AuthScheme |
string |
3 | HTTP authentication schemes |
Charset |
string |
20 | Common character encodings |
All enums live under the SineMacula\Http\Enums namespace.
Helper Methods
Each enum includes contextual helper methods:
- HttpStatus --
getCode(),getStatusLine(),getReasonPhrase(),isInformational(),isSuccess(),isRedirection(),isClientError(),isServerError() - HttpMethod --
getVerb(),isSafe(),isIdempotent() - MediaType --
getMimeType(),withCharset(),getExtension(),isApplication(),isText(),isMultipart(),isImage(),isAudio(),isVideo(),isFont() - HttpHeader --
getName(),isStandard() - CacheDirective --
isRequestDirective(),isResponseDirective() - Charset --
getEncoding()
Installation
Usage
Testing
Contributing
Contributions are welcome via GitHub pull requests.
Security
If you discover a security issue, please contact Sine Macula directly rather than opening a public issue.
License
Licensed under the Apache License, Version 2.0.
All versions of http-primitives-php with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
The package sinemacula/http-primitives-php contains the following files
Loading the files please wait ...