PHPackages                             aichenk/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. aichenk/http-client

ActiveLibrary

aichenk/http-client
===================

Simple Http Client

2.1.3(4y ago)32.9k↓100%21MITPHPPHP &gt;=5.6

Since Aug 8Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (14)Used By (1)

HttpClient
==========

[](#httpclient)

简易http请求类

运行环境
----

[](#运行环境)

- PHP 5.6+
- curl extension

安装方法
----

[](#安装方法)

1. 根目录运行

    ```
     composer require aichenk/http-client

    ```
2. 在`composer.json`中声明

    ```
     "require": {
         "aichenk/http-client": "^2.0"
     }

    ```

使用
--

[](#使用)

```
$client = new Client('http://aichenk.com');
//$client->verifySSL(false);
$response = $client->get('/check.php', ['a' => 1]);

if (!$response->isSuccess()) {
    //do something
}
echo $response->getBody();
```

更新日志
----

[](#更新日志)

2022-04-24 - v2.1.3

- 修复`Response`高语法问题

2022-04-15 - v2.1.2

- `Response->getInfo()` 方法增加`method`信息

2022-01-05 - v2.1.1

- `HttpClient`增加`resetAfterRequest`构建函数参数、`resetAfterRequest($reset = false)`方法，请求结束后重置请求参数

2021-07-19 - v2.1.0

- `Response`增加`getInfo`方法，用于获取请求数据

2021-01-06 - v2.0.4

- 增加发送json请求快捷方法

2020-08-28 - v2.0.3

- 增加`setConnExceptionHandle`方法自定义处理连接异常

2020-08-02 - v2.0.2

- 所有请求增加`CURLOPT_POSTFIELDS`参数

2020-06-09 - v2.0.1

- 修复`Response`类中`is5xx`方法

2019-10-17 - v2.0.0

- `Client`命名更改为`HttpClient`
- 增加异常类
- `Response`类增加`getCode|is?xx`方法判断返回值

2019-08-13 - v1.0.3

- php版本要求增加到5.6

2019-08-11 - v1.0.2

- 更改setConnectTimeout|setTimeout实现方式
- 增加libcurl库版本&gt;=7.16.2要求

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~82 days

Recently: every ~118 days

Total

13

Last Release

1476d ago

Major Versions

1.0.3 → 2.0.02019-10-17

PHP version history (2 changes)1.0.1PHP &gt;=5.5

1.0.3PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7b581cba80f4aa30ab4a73b3edeecbcdbcc2c4e0c8af6d015e0571d9e2246fd?d=identicon)[aiChenK](/maintainers/aiChenK)

---

Top Contributors

[![aiChenK](https://avatars.githubusercontent.com/u/15376814?v=4)](https://github.com/aiChenK "aiChenK (18 commits)")

### Embed Badge

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

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

PHPackages © 2026

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