PHPackages                             hanwenbo/fetch - 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. hanwenbo/fetch

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

hanwenbo/fetch
==============

FaShop EasySwoole HttpClient

1.0.1(3y ago)073[1 issues](https://github.com/hanwenbo/fetch/issues)Apache-2.0PHPPHP &gt;=7.4

Since Mar 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hanwenbo/fetch)[ Packagist](https://packagist.org/packages/hanwenbo/fetch)[ RSS](/packages/hanwenbo-fetch/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

协程Http请求客户端
===========

[](#协程http请求客户端)

> 该类主要是为了解决第三方包用了guzzle基础请求方法保持一致，又能使用EasySwoole

安装
--

[](#安装)

```
composer require hanwenbo/fetch

```

测试
--

[](#测试)

```
php tests/fetch.php

```

> 要在`swoole` 环境下运行，根目录的 `docker-compose.yml` 是写项目经常用到的docker环境 docker-compose up -d docker-compose exec swoole bash composer install php tests/fetch.php

示例代码
----

[](#示例代码)

#### GET

[](#get)

```
$client = new \hanwenbo\fetch\Fetch();
	$res    = $client->request( 'GET', 'https://www.baidu.com', [
    'header'=>[
			'test'=>1
		],
		'query' => [
			'adada' => 121212,
		],
	] );
```

#### POST

[](#post)

> form请求

```
$client = new \hanwenbo\fetch\Fetch();
	$res    = $client->request( 'POST', 'https://www.baidu.com', [
    'header'=>[
			'test'=>1
		],
		'form_params' => [
			'adada' => 121212,
		],
	] );
```

> json请求

```
$client = new \hanwenbo\fetch\Fetch();
	$res    = $client->request( 'POST', 'https://www.baidu.com', [
    'header'=>[
			'test'=>1
		],
		'body' => [
			'adada' => 121212,
		],
	] );
```

> 其他的 `PUT` `DELETE` `PATCH` 参考 `POST` 即可

### 其他

[](#其他)

-
-
-
- [https://guzzle-cn.readthedocs.io/zh\_CN/latest/](https://guzzle-cn.readthedocs.io/zh_CN/latest/)
-

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

2

Last Release

1262d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

httpphpcurlGuzzleswooleeasyswoolefashop

### Embed Badge

![Health badge](/badges/hanwenbo-fetch/health.svg)

```
[![Health](https://phpackages.com/badges/hanwenbo-fetch/health.svg)](https://phpackages.com/packages/hanwenbo-fetch)
```

###  Alternatives

[swlib/saber

Swoole coroutine HTTP client

986144.0k23](/packages/swlib-saber)[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

77400.7k1](/packages/hannesvdvreken-guzzle-debugbar)[swoole-bundle/swoole-bundle

Open/Swoole Symfony Bundle

6646.5k](/packages/swoole-bundle-swoole-bundle)

PHPackages © 2026

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