chillerlan / php-httpinterface
A PSR-7/17/18 http client/interface implementation
Fund package maintenance!
Ko Fi
www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4
Installs: 6 187
Dependents: 3
Suggesters: 0
Security: 0
Stars: 10
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-simplexml: *
- ext-zlib: *
- chillerlan/php-http-message-utils: ^1.0
- chillerlan/php-settings-container: ^2.1
- fig/http-message-util: ^1.1.5
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- http-interop/http-factory-tests: ^0.9
- phan/phan: ^4.0
- phpunit/phpunit: ^9.5
README
A PSR-7/PSR-17/PSR-18 implementation.
NOTE: This library has abandoned the silly "immuatbility" that is dictated by PSR-7 for it is horseshit. Fluent interfaces just don't work like that, the pseudo-immutability gets in the way more often (always) than it is useful (never). If you want your fluent 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.
Documentation
See the wiki for advanced documentation. An API documentation created with phpDocumentor can be found at https://chillerlan.github.io/php-httpinterface/ (WIP).
Requirements
Installation
requires composer
composer.json (note: replace dev-main
with a version boundary)
{ "require": { "php": "^8.1", "chillerlan/php-httpinterface": "dev-main" } }
Note: replace dev-main
with a version constraint, e.g. ^5.0
- see releases for valid versions.
In case you want to keep using dev-main
, specify the hash of a commit to avoid running into unforseen issues like so: dev-main#8ac7f056ef2d492b0c961da29472c27324218b83
Profit!
License information
This library contains portions of code (especially tests) from the following libraries:
- Guzzle PSR-7 (MIT)
- bakame-php psr7-uri-interface-tests (MIT)
- Slim (MIT)
- nyholm PSR-7 (MIT)
- caridea-dispatch (Apache)