Laravel PSR-18 HTTP Client Bridge
Open Issues: 0
- php: ^7.4|^8.0
- laravel/framework: ^8.0|^9.0
- php-http/httplug: ^2.0
- friendsofphp/php-cs-fixer: ^3.8
- guzzlehttp/guzzle: ^7.4
- orchestra/testbench: ^6.24|^7.5
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2023-03-17 11:03:49 UTC
Provides a bridge to use the Laravel HTTP Client as PSR-18 (or PHP-HTTP) HTTP Client. Created as an experiment to use the HTTP response fakes and assertions in tests, for libraries that require a PSR-18 HTTP Client.
$ composer require swisnl/laravel-psr-http-client-bridge
$client = new Swis\Laravel\Bridge\PsrHttpClient\Client(); $request = new Psr\Http\Message\RequestImplementation(); $response = $client->sendRequest($request);
If you want to configure some request options, you can provide a callable that returns a
$client = new Swis\Laravel\Bridge\PsrHttpClient\Client(fn () => Http::withOptions(['proxy' => 'http://localhost:8125']));
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
SWIS ❤️ Open Source
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.