定制 reneiw/hiei 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固