superbrave / verbose-error-http-client
在 Symfony HTTP 客户端中增加错误信息的详细程度。
2.1.2
2024-04-26 12:27 UTC
Requires
- php: ^8.2
- symfony/dependency-injection: ^6.3|^7.0
- symfony/framework-bundle: ^6.3|^7.0
- symfony/http-client-contracts: ^3.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.54
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6
- roave/security-advisories: dev-latest
- symfony/http-client: ^6.3|^7.0
Suggests
- symfony/http-client: This package requires an actual Symfony HTTP client implementation to decorate.
Provides
This package is auto-updated.
Last update: 2024-08-26 13:13:11 UTC
README
在 Symfony HTTP 客户端中增加错误信息的详细程度。
使用 Composer 安装
运行以下命令将包添加到项目的 composer.json 中
$ composer require superbrave/verbose-error-http-client-bundle symfony/http-client
可以替换 symfony/http-client
为任何其他实现 Symfony HTTP 客户端合约的 HTTP 客户端。
用法
以下示例展示了如何创建执行带详细异常信息的请求所需的实例
<?php use Superbrave\VerboseErrorHttpClient\HttpClient\VerboseErrorHttpClient;use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); $verboseErrorHttpClient = new VerboseErrorHttpClient($httpClient); $response = $verboseErrorHttpClient->request('GET', 'https://superbrave.nl/api');
许可证
详细的错误 HTTP 客户端遵循 MIT 许可证。请参阅 LICENSE 文件 获取详细信息。