Download the PHP package chillerlan/php-httpinterface without Composer
On this page you can find all versions of the php package chillerlan/php-httpinterface. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-httpinterface
chillerlan/php-httpinterface
A PSR-7/PSR-17/PSR-18 HTTP message/client implementation.
Documentation
An API documentation created with phpDocumentor can be found at https://chillerlan.github.io/php-httpinterface/ (WIP).
Requirements
- PHP 8.1+
ext-curl
- from dependencies:
ext-fileinfo
ext-intl
ext-json
ext-mbstring
ext-simplexml
ext-zlib
Installation with composer
Terminal
composer.json
Note: replace dev-main
with a version constraint, e.g. ^6.0
- see releases for valid versions.
Profit!
Quickstart
The HTTP clients CurlClient
and StreamClient
are invoked with a ResponseFactoryInterface
instance
as the first parameter, followed by optional HTTPOptions
and PSR-3 LoggerInterface
instances.
You can then send a request via the implemented PSR-18 method ClientInterface::sendRequest()
,
using a PSR-7 RequestInterface
and expect a PSR-7 ResponseInterface
.
CurlClient
, StreamClient
CurlMultiClient
The CurlMultiClient
client implements asynchronous multi requests ("rolling-curl").
It needs a MultiResponseHandlerInterface
that parses the incoming responses, the callback may return a failed request to the stack:
You can then invoke the multi request client - the MultiResponseHandlerInterface
and ResponseFactoryInterface
are mandatory,
HTTPOptions
and LoggerInterface
are optional:
URLExtractor
The URLExtractor
wraps a PSR-18 ClientInterface
to extract and follow shortened URLs to their original location.
LoggingClient
The LoggingClient
wraps a ClientInterface
and outputs the HTTP messages in a readable way through a LoggerInterface
(do NOT use in production!).
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 the directory .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!
All versions of php-httpinterface with dependencies
ext-curl Version *
chillerlan/php-http-message-utils Version ^2.2
chillerlan/php-settings-container Version ^3.1.1
chillerlan/psr-7 Version ^1.0
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-factory Version ^1.0
psr/log Version ^1.1 || ^2.0 || ^3.0