reneiw/hiei
最新稳定版本:1.2.0
Composer 安装命令:
composer require reneiw/hiei
包简介
Http request Is Especially Import!.
README 文档
README
- Http request Is Especially Import!.
Prompt
If you just need a returnable middleware.
then you can try caseyamcl/guzzle_retry_middleware.
I think you will like him.
Installing
Via Composer
$ composer require reneiw/hiei -vvv
Quickstart
use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\HandlerStack; use Reneiw\Hiei\HieiMiddleware; use Reneiw\Hiei\HTTPService; $stack = HandlerStack::create(); $stack->push( HieiMiddleware::factory( [ //Set a maximum number of attempts per request, default 10 'max_retry_attempts' => 2, // Only retry when status is equal to these response codes, default [429, 503] 'retry_on_status' => [204, 429, 503], ] ) ); $client = new Client(['handler' => $stack]); $http = new HTTPService( $client, [ 'errorCallback' => [ function ($method, $uri, $params, GuzzleException $e) { logger()->info('123', [$method, $uri, $params, $e->getMessage()]); }, function ($method, $uri, $params, GuzzleException $e) { logger()->info('223', [$method, $uri, $params, $e->getMessage()]); }, ], ] ); return $http->request('GET', 'http://www.google.com/generate_204');
Usage
TODO
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 818
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-28