chillerlan / psr-7
A PSR-7 HTTP message and PSR-17 HTTP factory implementation.
Fund package maintenance!
Ko-Fi
Installs: 3 240
Dependents: 1
Suggesters: 2
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- ext-mbstring: *
- chillerlan/php-http-message-utils: ^2.2.2
- fig/http-message-util: ^1.1.5
- psr/http-factory: ^1.1
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- ext-simplexml: *
- chillerlan/phpunit-http: ^1.0
- http-interop/http-factory-tests: ^2.1
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1.11
- phpstan/phpstan-deprecation-rules: ^1.2
- phpunit/phpunit: ^10.5
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3.10
Suggests
- chillerlan/php-http-message-utils: Utilities for use with PSR-7 message objects.
- chillerlan/php-httpinterface: A PSR-18 HTTP client implementation
- chillerlan/php-oauth: A PSR-7 OAuth client/handler that also acts as PSR-18 HTTP client
Provides
README
A PSR-7/PSR-17 HTTP message and factory implementation.
Overview
Features
- PSR-7 HTTP message implementation
- PSR-17 HTTP factory implementation
MultipartStreamBuilder
based on PSR-7Message
objects (RFC-2046, section 5.1)
Requirements
- PHP 8.1+
Documentation
The documentation of the PSR-7 interfaces can be found over at https://www.php-fig.org/psr/psr-7/.
NOTE: This library has abandoned the paranoid "value object" "immuatbility" that is dictated by PSR-7 for it is horseshit. The pseudo-immutability gets in the way more often (always) than it is useful (never) and creates endless overhead. If you want your objects to be immutable for whatever reason, just fucking clone them and don't force countless libraries to do that for you instead. If you don't like it, just use Guzzle instead (spoiler: you won't notice the difference).
Auto generated API documentation
The API documentation can be auto generated with phpDocumentor. There is an online version available via the gh-pages branch that is automatically deployed on each push to main.
Locally created docs will appear in .build/phpdocs/
. If you'd like to create local docs, please follow these steps:
- download phpDocumentor v3+ as .phar archive
- run it in the repository root directory:
- on Windows
c:\path\to\php.exe c:\path\to\phpDocumentor.phar --config=phpdoc.xml
- on Linux just
php /path/to/phpDocumentor.phar --config=phpdoc.xml
- on Windows
- open index.html in a browser
- profit!
Disclaimer
Use at your own risk!
License information
This library contains portions of code (tests) from the following libraries:
- Guzzle PSR-7 (MIT)
- Slim (MIT)