PHPackages                             clearswitch/bleach-http - 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. clearswitch/bleach-http

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

clearswitch/bleach-http
=======================

client http

0.1.0(2y ago)077MITPHP

Since Nov 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ClearSwicth/Bleach-Http)[ Packagist](https://packagist.org/packages/clearswitch/bleach-http)[ RSS](/packages/clearswitch-bleach-http/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (12)Used By (0)

Bleach-Http
===========

[](#bleach-http)

Client http

```
use ClearSwitch\BleachHttp\Request;
$request=new Request();
//设置请求的地址
$request->setUrl("url");
//设置请求通道，支持curl
$request->setRequestAisle("curl");
// 可以添加自己的通道分两步1.先注册通道，2设置通道
$request->addAisle('通道名字','回调')
$request->setRequestAisle("通道名字")
//设置请求头
$request->setHeader(['Content-Type'=>'application/json']);
//设置代理
$request->setProxy('host','port');
//设置请求体的格式
//暂时支持 'json', 'xml', 'form_data', 'urlencoded'的body
$request->setContent([],'json');
//如果上传文件的时候， 文件需要打标
$data = [
            'file' => TagParam::file('/Users/daikai/project/php/logisticApi/.env')
        ];
//设置请求方法默认是get
$request->setMethod("post");
//设置请求超时时间 默认10
$request->setTimeOut(300);
//这些设置都是可以链式写发的
$request->setUrl('')->setMethod('post')->send();
//发送请求
$response=$request->send();
```

响应
==

[](#响应)

```
 use ClearSwitch\BleachHttp\Request;
 $request=new Request();
 $response=$request->send();
 //获得响应的数据，帮你转为数组
 $response->getBody();
//获得响应的原样的body
 $response->getRowContent();
//获得cookies
 $response->getCookies();
//获得响应的头，转为数据
 $response->getHeaders();
//原样输出响应头
 $response->getRawHeaders();
//获得响应的code
 $response->getStatusCode();
//获得相依的完成数据
$response->getRowResponse();
//发送完请求是可以直接链式写的
$request->send()->getBody();
```

\#批量请求

```
use ClearSwitch\BleachHttp\BatchRequest;
use ClearSwitch\BleachHttp\Request;
$batch=new BatchRequest();
$requests = [];

for($i = 0; $i < 100; $i++){
    $request = new Request();
    $request->setUrl('');
    $request->setContent([]);
    $requests[] = $request;
}
//设置批量请求
//参数2是选填的，用来设置并发数，默认的并发是50
$batch->setRequests($requests,3);
//发送批量请求
$responses = $batch->send();
foreach ($responses as $response){
 //获得响应的数据，帮你转为数组
  $response->getBody();
//...获得结果其他方法和上面的request 一致
}
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

Every ~6 days

Recently: every ~16 days

Total

11

Last Release

883d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47359?v=4)[The Apache Software Foundation](/maintainers/Apache)[@apache](https://github.com/apache)

---

Top Contributors

[![ClearSwicth](https://avatars.githubusercontent.com/u/47941313?v=4)](https://github.com/ClearSwicth "ClearSwicth (30 commits)")

### Embed Badge

![Health badge](/badges/clearswitch-bleach-http/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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