PHPackages                             jdmmswoft/http-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. jdmmswoft/http-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

jdmmswoft/http-client
=====================

http-client for swoft2

1.0.10.x-dev(4y ago)031MITPHP

Since Jun 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/li2301313/jdmmswoft-http-client)[ Packagist](https://packagist.org/packages/jdmmswoft/http-client)[ RSS](/packages/jdmmswoft-http-client/feed)WikiDiscussions 1.0.10 Synced 1mo ago

READMEChangelogDependencies (1)Versions (1)Used By (1)

http客户端
-------

[](#http客户端)

#### 简介

[](#简介)

对`Swlib\Saber`组件的简易封装,使其能够被调用链监控.同时保证与原来用法尽量一致.

#### 安装

[](#安装)

```
composer require jdmmswoft/http-client
```

#### 配置

[](#配置)

- bean.php

```
"user" => [
        'class' => \Jdmm\Saber\SaberJdmm::class,
        'name'  => 'user', //名称.与请求无关.但是调用链监控时候会使用.
        'base_uri' => 'http://user.com', //因为Saber包的特殊处理原因.导致必须增加协议头.
        'options' => [
            //此处增加一些头部信息以及超时时间的选项.配置项参考
            // https://github.com/swlib/saber#%E9%85%8D%E7%BD%AE%E5%8F%82%E6%95%B0%E8%A1%A8
        ],
    ],
```

#### 使用说明

[](#使用说明)

- 方法使用基本兼容SaberGM类.只是将静态方法的调用改为了通过bean()实例化
- 支持通过注解注入.
- 强烈建议使用代理.好处多多...

#### 示例

[](#示例)

- UserProxy.php

```
namespace App\Proxy;

use Swoft\Bean\Annotation\Mapping\Bean;
use Swoft\Bean\Annotation\Mapping\Inject;
use Jdmm\Saber\SaberJdmm;

/**
 * Class UserProxy
 * @package App\Proxy
 * @Bean()
 */
class UserProxy
{
    /**
     * @var SaberJdmm
     * @Inject("user")
     */
    private $user;

    public function getById($id) {
        //方式一
        $user = \bean('user');

        //方式二
        $user = $this->user;

        $path = '/user/getId';
        $data = [
            'id' => $id,
        ];
        $url = $user->getUrl($path, $data);
        $reponse = $localhost->get($url);
        return $reponse->getParsedJsonArray();
    }
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1802d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39173e08b359987d44e2d9e947b1c967c02203ac3b81857ee3e2c44ac2dfca0e?d=identicon)[li2301313](/maintainers/li2301313)

---

Top Contributors

[![li2301313](https://avatars.githubusercontent.com/u/25633267?v=4)](https://github.com/li2301313 "li2301313 (2 commits)")

---

Tags

phphttp clientswoftSwlib-Saber

### Embed Badge

![Health badge](/badges/jdmmswoft-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/jdmmswoft-http-client/health.svg)](https://phpackages.com/packages/jdmmswoft-http-client)
```

###  Alternatives

[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[swoft/http-client

HTTP Client Component for Swoft

1139.3k4](/packages/swoft-http-client)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[simpod/clickhouse-client

PHP ClickHouse Client

19116.7k](/packages/simpod-clickhouse-client)[swoft/websocket-server

swoft websocket server component

16134.1k3](/packages/swoft-websocket-server)[popphp/pop-http

Pop Http Component for Pop PHP Framework

1018.5k13](/packages/popphp-pop-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
