PHPackages                             wp-oop/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-oop/http-client

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

wp-oop/http-client
==================

A PSR-18 wrapper for the WordPress HTTP API

0.1.x-dev(2y ago)32.7k↓100%MITPHPPHP ^7.4 | ^8.0

Since Aug 14Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (12)Versions (3)Used By (0)

WP HTTP Client
==============

[](#wp-http-client)

[![Continuous Integration](https://camo.githubusercontent.com/1996dd17c49ecff687f333833240936e93c529cf9ab65efdabf8581fd96200d2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f77702d6f6f702f687474702d636c69656e742f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6c6f676f3d676974687562266c6f676f436f6c6f723d464646464646)](https://github.com/wp-oop/http-client/actions/workflows/continuous-integration.yml)[![Packagist PHP Version Support](https://camo.githubusercontent.com/c96b327a56e6dd26d976063efda2df0d59084de6136e20bee938af9b964ba476/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d6f6f702f687474702d636c69656e74)](https://packagist.org/packages/wp-oop/http-client)[![Latest Stable Version](https://camo.githubusercontent.com/3ed26364c30cb74387b31b9fc13ddf7dcb539db9885556e9206bddd9f776578a/68747470733a2f2f706f7365722e707567782e6f72672f77702d6f6f702f687474702d636c69656e742f76)](https://packagist.org/packages/wp-oop/http-client)[![Latest Unstable Version](https://camo.githubusercontent.com/6d928181f0b9d043e38eb64ee66187960b40731f20891b4c57dde7768a7538aa/68747470733a2f2f706f7365722e707567782e6f72672f77702d6f6f702f687474702d636c69656e742f762f756e737461626c65)](https://packagist.org/packages/wp-oop/http-client)

A [PSR-18](https://www.php-fig.org/psr/psr-18/) wrapper for the [WordPress HTTP API](https://developer.wordpress.org/plugins/http-api/).

Usage
-----

[](#usage)

```
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use WpOop\HttpClient\Client;

/** @var RequestFactoryInterface $requestFactory */
/** @var ResponseFactoryInterface $responseFactory */

// Set up the client with WP request options
// https://developer.wordpress.org/reference/classes/wp_http/request/
$client = new Client(
    // Default args to WP_Http::request()
    [
        'redirection' => 2,
        'timeout' => 60,
    ],
    $responseFactory,
    // Path to proxy file dir to enable response streaming.
    // If null, will buffer in memory instead.
    get_temp_dir()
);

// Create a PSR-7 request in any way you want, for example via a PSR-17 factory
$request = $requestFactory->createRequest('GET', 'http://somesite.com/api');

try {
    // Send a request as usual, consuming a familiar PSR-18 interface
    $response = $client->sendRequest($request);
} catch (ClientExceptionInterface $e) {
    // Handle PSR-18 exceptions
}
```

Since this is a [PSR-18](https://www.php-fig.org/psr/psr-18/)-compliant implementation, you can consume it in the way you would any other.

To set it up, pass a map of WP request options, and a [PSR-17](https://www.php-fig.org/psr/psr-17/) response factory. This approach facilitates decoupling from any concrete [PSR-7](https://www.php-fig.org/psr/psr-7/) implementation.

You can use any [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation) or [PSR-7 implementations](https://packagist.org/providers/psr/http-message-implementation). I suggest the slim and efficient [nyholm/psr7](https://packagist.org/packages/nyholm/psr7), which conveniently implements both.

Limitations
-----------

[](#limitations)

Currently only throws [`ClientExceptionInterface`](https://github.com/php-fig/http-client/blob/master/src/ClientExceptionInterface.php), as it is unable to reliably determine whether a network or another specific kind of problem has occurred from the error value returned by [`wp_remote_request()`](https://developer.wordpress.org/reference/functions/wp_remote_request/).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

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

Total

2

Last Release

984d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1894e91b32c9f80d8f30a42d360af6983a507f1cf2c621b7c9a0a0de14e011c5?d=identicon)[XedinUnknown](/maintainers/XedinUnknown)

---

Top Contributors

[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (22 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[shopware/app-php-sdk

Shopware App SDK for PHP

1577.8k1](/packages/shopware-app-php-sdk)

PHPackages © 2026

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