PHPackages                             wp-php-toolkit/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. wp-php-toolkit/http-client

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

wp-php-toolkit/http-client
==========================

HttpClient component for WordPress.

v0.4.1(5mo ago)02.6k↓33.3%5GPL-2.0-or-laterPHPPHP &gt;=7.2

Since May 30Pushed 4mo agoCompare

[ Source](https://github.com/wp-php-toolkit/http-client)[ Packagist](https://packagist.org/packages/wp-php-toolkit/http-client)[ RSS](/packages/wp-php-toolkit-http-client/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (4)Versions (32)Used By (5)

HTTP Client
===========

[](#http-client)

An asynchronous HTTP client library.

### Key Features

[](#key-features)

- **No dependencies:** Works on vanilla PHP without external libraries. `SocketClient` uses `stream_socket_client()` for non-blocking HTTP requests and `CurlClient` uses `curl_multi` for parallel requests.
- **Streaming support:** Enables efficient handling of large response bodies.
- **Progress monitoring:** Track the progress of requests and responses.
- **Concurrency limits:** Control the number of simultaneous connections.
- **PHP 7.2+ support and no dependencies:** Works on vanilla PHP without external libraries.

### Usage Example

[](#usage-example)

```
$requests = [
    new Request("[https://wordpress.org/latest.zip](https://wordpress.org/latest.zip)"),
    new Request("[https://raw.githubusercontent.com/wpaccessibility/a11y-theme-unit-test/master/a11y-theme-unit-test-data.xml](https://raw.githubusercontent.com/wpaccessibility/a11y-theme-unit-test/master/a11y-theme-unit-test-data.xml)"),
];

// Creates the most appropriate client based for your environment.
$client = Client::create();
$client->enqueue($requests);

while ($client->await_next_event()) {
    $event = $client->get_event();
    $request = $client->get_request();

    if ($event === Client::EVENT_BODY_CHUNK_AVAILABLE) {
        $chunk = $client->get_response_body_chunk();
        // Process the chunk...
    }
    // Handle other events...
}
```

### TODO

[](#todo)

- Request headers – accept string lines such as "Content-type: text/plain" instead of key-value pairs. K/V pairs are confusing and lead to accidental errors such as `0: Content-type: text/plain`. They also diverge from the format that curl accepts.
- Response caching – add a custom cache handler for easy caching of the same URLs
- Response caching – support HTTP cache-control headers

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance72

Regular maintenance activity

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 52.5% 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

Total

31

Last Release

179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82f8b6f87f741a78784d7453f52734516053272d36325c5cf23b24df0baffe8d?d=identicon)[AZielinski](/maintainers/AZielinski)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (31 commits)")[![adamziel](https://avatars.githubusercontent.com/u/205419?v=4)](https://github.com/adamziel "adamziel (27 commits)")[![JanJakes](https://avatars.githubusercontent.com/u/141436?v=4)](https://github.com/JanJakes "JanJakes (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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