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

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

rx/http
=======

Http Client for RxPHP

2.1.3(3y ago)221.5k2[1 issues](https://github.com/RxPHP/RxHttp/issues)2MITPHPPHP &gt;=7.0

Since Feb 6Pushed 3y ago3 watchersCompare

[ Source](https://github.com/RxPHP/RxHttp)[ Packagist](https://packagist.org/packages/rx/http)[ RSS](/packages/rx-http/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (4)Versions (11)Used By (2)

Http Client for RxPHP
=====================

[](#http-client-for-rxphp)

This library is a RxPHP wrapper for the [ReactPHP's Http-client](https://github.com/reactphp/http-client) library. It allows you to make asynchronous http calls and emit the results through an RxPHP observable.

It uses the [Voryx event-loop](https://github.com/voryx/event-loop) which behaves like the Javascript event-loop. ie. You don't need to start it.

\##Installation

Install dependencies using [composer](https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable)

```
  $ php composer.phar require "rx/http"

```

Usage
-----

[](#usage)

### Get

[](#get)

```

$source = \Rx\React\Http::get('https://www.example.com/');

$source->subscribe(
    function ($data) {
        echo $data, PHP_EOL;
    },
    function (\Exception $e) {
        echo $e->getMessage(), PHP_EOL;
    },
    function () {
        echo "completed", PHP_EOL;
    }
);

```

### Post

[](#post)

```

$postData = json_encode(["test" => "data"]);
$headers  = ['Content-Type' => 'application/json'];

$source = \Rx\React\Http::post('https://www.example.com/', $postData, $headers);

$source->subscribe(
    function ($data) {
        echo $data, PHP_EOL;
    },
    function (\Exception $e) {
        echo $e->getMessage(), PHP_EOL;
    },
    function () {
        echo "completed", PHP_EOL;
    }
);

```

### Multiple Asynchronous Requests

[](#multiple-asynchronous-requests)

```
$imageTypes = ["png", "jpeg", "webp"];

$images = \Rx\Observable::fromArray($imageTypes)
    ->flatMap(function ($type) {
        return \Rx\React\Http::get("http://httpbin.org/image/{$type}")->map(function ($image) use ($type) {
            return [$type => $image];
        });
    });

$images->subscribe(
    function ($data) {
        echo "Got Image: ", array_keys($data)[0], PHP_EOL;
    },
    function (\Exception $e) {
        echo $e->getMessage(), PHP_EOL;
    },
    function () {
        echo "completed", PHP_EOL;
    }
);
```

For more information, see the [examples](examples).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~303 days

Recently: every ~503 days

Total

9

Last Release

1328d ago

Major Versions

0.2.0 → 2.0.02017-01-10

PHP version history (2 changes)2.0.0PHP ^7.0

2.1.2PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/97c5ea11cb85867441e824660b316d8c4c081400e21781c56bb561f1f5b0bb87?d=identicon)[davidwdan](/maintainers/davidwdan)

---

Top Contributors

[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (15 commits)")[![mbonneau](https://avatars.githubusercontent.com/u/748287?v=4)](https://github.com/mbonneau "mbonneau (1 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (1 commits)")

---

Tags

httpreactphpreactrx.phpreactivex

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[react/http

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

78126.4M414](/packages/react-http)[domraider/rxnet

Rx connector for PHP

1308.6k1](/packages/domraider-rxnet)[clue/http-proxy-react

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP

472.3M33](/packages/clue-http-proxy-react)[rx/websocket

Websockets for PHP using Rx

34181.5k2](/packages/rx-websocket)[php-http/react-adapter

React HTTP Adapter

19260.9k3](/packages/php-http-react-adapter)[yosymfony/httpserver

A simple HTTP server

1940.1k1](/packages/yosymfony-httpserver)

PHPackages © 2026

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