PHPackages                             lanzhi/php-coroutine-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. lanzhi/php-coroutine-http-client

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

lanzhi/php-coroutine-http-client
================================

php coroutine http client

0.1(8y ago)013MITPHPPHP &gt;=7.0

Since Apr 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ziqingliang/php-coroutine-http-client)[ Packagist](https://packagist.org/packages/lanzhi/php-coroutine-http-client)[ RSS](/packages/lanzhi-php-coroutine-http-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

\##协程 HTTP 客户端

#### 简介

[](#简介)

提供可以在协程模式下工作的非阻塞 HTTP 请求功能。
当前根据项目实际需要，仅提供最小化功能。

#### 具体功能如下：

[](#具体功能如下)

1. 只支持 GET、POST 请求；
2. 不支持文件上传；
3. 不支持 HTTPS 协议；
4. 不支持 gzip、deflate 等内容编码；
5. 不支持 COOKIE；
6. 不支持认证机制；

#### 使用方式：

[](#使用方式)

API 参照 guzzlehttp 设计，不过不支持其中部分选项。
Example 1:

```
include __DIR__."/../vendor/autoload.php";

use lanzhi\http\Client;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Logger\ConsoleLogger;

$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_VERY_VERBOSE);
$client = new Client([], new ConsoleLogger($output));

//file:get.php 将拿到的 $_GET 参数 ksort 排序之后，使用 json_encode($get, JSON_UNESCAPED_UNICODE) 转换为字符串输出
$uri = "test.com/get.php";
$query = [
    'name' => 'lanzhi',
    'sex'  => 'male',
    'age'  => 'unknown',
    'tag'  => uniqid()
];

$request = $client->get($uri, ['query'=>$query]);
$request->run();
$response = $request->getReturn();
if($response->getBody()){
    echo "response body size:", $response->getBody()->getSize(), "\n";
    ksort($query);
    echo "query: ", json_encode($query, JSON_UNESCAPED_UNICODE), "\n";
    echo "body:  ", $response->getBody()->getContents(), "\n";
}else{
    var_dump($response);
}

echo "response status: ", $response->getStatusCode(), "\n";
echo "response phrase: ", $response->getReasonPhrase(), "\n\n";
```

其它可参见项目 examples 目录

#### 联系作者

[](#联系作者)

QQ : 310929334
微信: lanzhi\_me

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~3 days

Total

5

Last Release

2928d ago

### Community

Maintainers

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

---

Tags

httpphpclienthttp clientcoroutine

### Embed Badge

![Health badge](/badges/lanzhi-php-coroutine-http-client/health.svg)

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

###  Alternatives

[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[swlib/saber

Swoole coroutine HTTP client

985145.0k27](/packages/swlib-saber)[simpod/clickhouse-client

PHP ClickHouse Client

19116.7k](/packages/simpod-clickhouse-client)[swoole/etcd-client

Grpc PHP Client base on Swoole Http2 Coroutine

1973.2k1](/packages/swoole-etcd-client)[amphp/http-client-guzzle-adapter

Guzzle adapter for Amp's HTTP client.

1523.6k1](/packages/amphp-http-client-guzzle-adapter)[swoft/http-client

HTTP Client Component for Swoft

1139.3k4](/packages/swoft-http-client)

PHPackages © 2026

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