alex-kalanis / remote-request-psr
Remote Request adapter for PSR-7 and PSR-18
v1.1.0
2024-03-31 09:43 UTC
Requires
- php: >=7.4.0
- ext-mbstring: *
- alex-kalanis/remote-request: >=6.3 <7
- psr/http-client: ^1.0
- psr/http-message: >=2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: >=7.2 <=9
- shipmonk/composer-dependency-analyser: ^1.4
This package is auto-updated.
Last update: 2024-10-31 00:18:07 UTC
README
PSR adapter for connecting Remote Request into your application with public interfaces.
PHP Installation
composer.phar require alex-kalanis/remote-request-psr
(Refer to Composer Documentation if you are not familiar with composer)
PHP Usage
1.) Use your autoloader (if not already done via Composer autoloader)
2.) Add some external packages with connection to the local or remote services.
3.) Connect the "\kalanis\RemoteRequestPsr\Processor\Simple" into your app.
5.) Just call request
Usages
Basic data sending through network. In this case just use php's internal streams.
$request = \kalanis\RemoteRequestPsr\Content\Request(); // ... $request is PSR request class WITHOUT immutability. So the most things works. $lib = new \kalanis\RemoteRequestPsr\Processor\Simple(); $response = $lib->process($request); // ... $response is PSR response class WITHOUT immutability. So the most things works. return strval($response->getBody());