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

ActiveComposer-plugin[HTTP &amp; Networking](/categories/http)

php-http/discovery
==================

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

1.20.0(1y ago)1.3k309.5M↑11.9%47[3 issues](https://github.com/php-http/discovery/issues)[2 PRs](https://github.com/php-http/discovery/pulls)20MITPHPPHP ^7.1 || ^8.0

Since Jun 12Pushed 5mo ago12 watchersCompare

[ Source](https://github.com/php-http/discovery)[ Packagist](https://packagist.org/packages/php-http/discovery)[ Docs](http://php-http.org)[ RSS](/packages/php-http-discovery/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (59)Used By (20)

HTTPlug Discovery
=================

[](#httplug-discovery)

[![Latest Version](https://camo.githubusercontent.com/bb64ccc142b26d88d1a6f57d801c1736f8b708989ec6d0ca1a329ed2db4f6e69/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7068702d687474702f646973636f766572792e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-http/discovery/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://github.com/php-http/discovery/actions/workflows/ci.yml/badge.svg?branch=1.x)](https://github.com/php-http/discovery/actions/workflows/ci.yml?query=branch%3A1.x)[![Code Coverage](https://camo.githubusercontent.com/343350ff78957dd09508ee08d18dbe81215f7cbc37967b0922b662bdedf220c1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7068702d687474702f646973636f766572792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/php-http/discovery)[![Quality Score](https://camo.githubusercontent.com/0ffb3efac5261a4c62993abf07b8fbabbfc61148513e655fa8d45722b01e8af6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7068702d687474702f646973636f766572792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/php-http/discovery)[![Total Downloads](https://camo.githubusercontent.com/d54e9a2254d0b2820a6c07e114b790759ea0d4f78362331bd71e5dda6c2912c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d687474702f646973636f766572792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/php-http/discovery)

**This library provides auto-discovery and auto-installation of well-known PSR-17, PSR-18 and HTTPlug implementations.**

Install
-------

[](#install)

Via Composer

```
composer require php-http/discovery
```

Usage as a library author
-------------------------

[](#usage-as-a-library-author)

Please see the [official documentation](http://php-http.readthedocs.org/en/latest/discovery.html).

If your library/SDK needs a PSR-18 client, here is a quick example.

First, you need to install a PSR-18 client and a PSR-17 factory implementations. This should be done only for dev dependencies as you don't want to force a specific implementation on your users:

```
composer require --dev symfony/http-client
composer require --dev nyholm/psr7
```

Then, you can disable the Composer plugin embeded in `php-http/discovery`because you just installed the dev dependencies you need for testing:

```
composer config allow-plugins.php-http/discovery false
```

Finally, you need to require `php-http/discovery` and the generic implementations that your library is going to need:

```
composer require 'php-http/discovery:^1.17'
composer require 'psr/http-client-implementation:*'
composer require 'psr/http-factory-implementation:*'
```

Now, you're ready to make an HTTP request:

```
use Http\Discovery\Psr18Client;

$client = new Psr18Client();

$request = $client->createRequest('GET', 'https://example.com');
$response = $client->sendRequest($request);
```

Internally, this code will use whatever PSR-7, PSR-17 and PSR-18 implementations that your users have installed.

Usage as a library user
-----------------------

[](#usage-as-a-library-user)

If you use a library/SDK that requires `php-http/discovery`, you can configure the auto-discovery mechanism to use a specific implementation when many are available in your project.

For example, if you have both `nyholm/psr7` and `guzzlehttp/guzzle` in your project, you can tell `php-http/discovery` to use `guzzlehttp/guzzle` instead of `nyholm/psr7` by running the following command:

```
composer config extra.discovery.psr/http-factory-implementation GuzzleHttp\\Psr7\\HttpFactory
```

This will update your `composer.json` file to add the following configuration:

```
{
    "extra": {
        "discovery": {
            "psr/http-factory-implementation": "GuzzleHttp\\Psr7\\HttpFactory"
        }
    }
}
```

Don't forget to run `composer install` to apply the changes, and ensure that the composer plugin is enabled:

```
composer config allow-plugins.php-http/discovery true
composer install
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).

Security
--------

[](#security)

If you discover any security related issues, please contact us at .

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

71

—

ExcellentBetter than 100% of packages

Maintenance56

Moderate activity, may be stable

Popularity79

Solid adoption and visibility

Community58

Growing community involvement

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~76 days

Total

58

Last Release

593d ago

Major Versions

v0.9.1 → v1.0.02016-07-18

PHP version history (7 changes)v0.1.0PHP &gt;=5.4

v0.6.1PHP ^5.4|7.\*

v0.9.0PHP ^5.4 || ^7.0

v0.9.1PHP ^5.5|^7.0

v1.0.0PHP ^5.5 || ^7.0

1.7.0PHP ^7.1

1.9.1PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://avatars.githubusercontent.com/u/76576?v=4)[David Buchmann](/maintainers/dbu)[@dbu](https://github.com/dbu)

![](https://www.gravatar.com/avatar/808f1df1f6ccd749b9c985f3b4a8753788e9bf74e7cead639fcf49cd2a714fd0?d=identicon)[egeloen](/maintainers/egeloen)

![](https://www.gravatar.com/avatar/3fb6e13a139230893f783118651540d3d057979fd726fefd135b1b397873010e?d=identicon)[php-http](/maintainers/php-http)

---

Top Contributors

[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (96 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (90 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (54 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (20 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (11 commits)")[![joelwurtz](https://avatars.githubusercontent.com/u/90466?v=4)](https://github.com/joelwurtz "joelwurtz (9 commits)")[![Jean85](https://avatars.githubusercontent.com/u/6729988?v=4)](https://github.com/Jean85 "Jean85 (5 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (3 commits)")[![mekras](https://avatars.githubusercontent.com/u/192067?v=4)](https://github.com/mekras "mekras (3 commits)")[![boesing](https://avatars.githubusercontent.com/u/2189546?v=4)](https://github.com/boesing "boesing (2 commits)")[![ddeboer](https://avatars.githubusercontent.com/u/89267?v=4)](https://github.com/ddeboer "ddeboer (2 commits)")[![pascal-hofmann](https://avatars.githubusercontent.com/u/2102878?v=4)](https://github.com/pascal-hofmann "pascal-hofmann (2 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (2 commits)")[![tgalopin](https://avatars.githubusercontent.com/u/1651494?v=4)](https://github.com/tgalopin "tgalopin (1 commits)")[![tuupola](https://avatars.githubusercontent.com/u/21913?v=4)](https://github.com/tuupola "tuupola (1 commits)")[![vjik](https://avatars.githubusercontent.com/u/525501?v=4)](https://github.com/vjik "vjik (1 commits)")[![webmaster777](https://avatars.githubusercontent.com/u/2650744?v=4)](https://github.com/webmaster777 "webmaster777 (1 commits)")[![yguedidi](https://avatars.githubusercontent.com/u/1480128?v=4)](https://github.com/yguedidi "yguedidi (1 commits)")[![captn3m0](https://avatars.githubusercontent.com/u/584253?v=4)](https://github.com/captn3m0 "captn3m0 (1 commits)")[![k4emic](https://avatars.githubusercontent.com/u/213865?v=4)](https://github.com/k4emic "k4emic (1 commits)")

---

Tags

httpmessageclientfactorypsr7adapterdiscoverypsr17

### Embed Badge

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

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

###  Alternatives

[php-http/httplug-bundle

Symfony integration for HTTPlug

38921.0M54](/packages/php-http-httplug-bundle)[php-http/multipart-stream-builder

A builder class that help you create a multipart stream

29390.9M224](/packages/php-http-multipart-stream-builder)[swlib/saber

Swoole coroutine HTTP client

985145.0k27](/packages/swlib-saber)[vultr/vultr-php

The Official Vultr API PHP Wrapper.

2243.9k1](/packages/vultr-vultr-php)[php-http/laravel-httplug

Laravel package to integrate the Httplug generic HTTP client into Laravel

12110.1k](/packages/php-http-laravel-httplug)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.2k3](/packages/pdeans-http)

PHPackages © 2026

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