PHPackages                             thomasvargiu/httplug-module - 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. thomasvargiu/httplug-module

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

thomasvargiu/httplug-module
===========================

HTTPlug module for zend framework and zend-expressive

3.0.1(1y ago)031.8k—9.3%[1 PRs](https://github.com/thomasvargiu/httplug-module/pulls)MITPHPPHP ^8.0

Since Jul 4Pushed 1y agoCompare

[ Source](https://github.com/thomasvargiu/httplug-module)[ Packagist](https://packagist.org/packages/thomasvargiu/httplug-module)[ RSS](/packages/thomasvargiu-httplug-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (30)Versions (11)Used By (0)

HTTPlug Module
==============

[](#httplug-module)

[![Latest Stable Version](https://camo.githubusercontent.com/dcd9efe332bbc4bb6b4f12899b24d2731f15f855d071fe06c2bfc968649af986/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/thomasvargiu/httplug-module)[![Total Downloads](https://camo.githubusercontent.com/f51d85f29ab10d1e7a659e2acd6f740264278ff537b28d8ba527c1f8bfbc9285/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f646f776e6c6f616473)](https://packagist.org/packages/thomasvargiu/httplug-module)[![License](https://camo.githubusercontent.com/253702421a95e47045a28e6fc4491d04cba3091d2e929f56cedbc39c196581da/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f6c6963656e7365)](https://packagist.org/packages/thomasvargiu/httplug-module)[![Code Coverage](https://camo.githubusercontent.com/3b7a51c0cda65689fd0c214b7f59e1ffdfd0ff4d8b64c7436025bf6a73cc4dab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thomasvargiu/httplug-module/?branch=master)[![Build Status](https://camo.githubusercontent.com/21ea2643c2bf45e88d078befbc74b3efe45b086740f3e28a8be25209c1bf6dc3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thomasvargiu/httplug-module/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7b4e25e8e8329a5bf39bd4de665cf812df150076e249cc5200e2be7973a0b949/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74686f6d61737661726769752f687474706c75672d6d6f64756c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thomasvargiu/httplug-module/?branch=master)

HTTPlug Module for [laminas](https://getlaminas.org/) and mezzio.

Visit  for more info.

Installation
------------

[](#installation)

```
composer require thomasvargiu/httplug-module

```

Full configuration
------------------

[](#full-configuration)

```
return [
    'httplug' => [
        // Global plugin configuration. When configured here, plugins need to be explicitly added to clients by service name.
        'plugins' => [
            'authentication' => [
                // The names can be freely chosen, the authentication type is specified in the "type" option
                'my_basic' => [
                    'type' => 'basic',
                    'options' => [
                        'username' => 'my_username',
                        'password' => 'p4ssw0rd',
                    ],
                ],
            ],
            'cache' => [
                'default' => [
                    // requires the php-http/cache-plugin package to be installed in your package
                    'cache_pool' => 'my_cache_pool',
                    'stream_factory' => 'httplug.stream_factory', // default to "httplug.stream_factory"
                    'options' => [
                        'default_ttl' => 3600,
                        'respect_cache_headers' => true,
                        'cache_key_generator' => null, // This must be a service id to a service implementing 'Http\Client\Common\Plugin\Cache\Generator\CacheKeyGenerator'. If 'null' 'Http\Client\Common\Plugin\Cache\Generator\SimpleGenerator' will be used.
                    ],
                ],
            ],
            'cookie' => [
                'default' => [
                    'cookie_jar' => 'my_cookie_jar_service',
                ],
            ],
            'decoder' => [
                'default' => [
                    'use_content_encoding' => true,
                ],
            ],
            'history' => [
                'default' => [
                    'journal' => 'my_journal',
                ],
            ],
            'logger' => [
                'default' => [
                    'logger' => 'logger',
                    'formatter' => null,
                ],
            ],
            'redirect' => [
                'default' => [
                    'preserve_header' => true,
                    'use_default_for_multiple' => true,
                ],
            ],
            'retry' => [
                'default' => [
                    'retry' => 1,
                ],
            ],
            'stopwatch' => [
                'default' => [
                    'stopwatch' => 'debug.stopwatch',
                ],
            ],
        ],

        'clients' => [
            'default' => [
                'factory' => 'httplug.client_factory.guzzle6',
                'service' => 'my_service',       // Can not be used with "factory" or "config"
                'config' => [
                    // Options to the Guzzle 6 constructor
                    'timeout' => 2,
                ],
                'plugins' => [
                    // Can reference a globally configured plugin service
                    'httplug.plugin.authentication.my_wsse',
                    // Can configure a plugin customized for this client
                    [
                        'name' => 'cache',
                        'config' => [
                            'cache_pool' => 'my_other_pool',
                            'options' => [
                                'default_ttl' => 120,
                            ],
                        ],
                    ],
                    // Can configure plugins that can not be configured globally
                    [
                        'name' => 'add_host',
                        'config' => [
                            // Host name including protocol and optionally the port number, e.g. https://api.local:8000
                            'host' => 'http://localhost:80', // Required
                            'options' => [
                                // Whether to replace the host if request already specifies it
                                'replace' => false,
                            ],
                        ],
                    ],
                    [
                        'name' => 'add_path',
                        'config' => [
                            // Path to be added, e.g. /api/v1
                            'path' => '/api/v1', // Required
                        ],
                    ],
                    [
                        'name' => 'base_uri',
                        'config' => [
                            // Base Uri including protocol, optionally the port number and prepend path, e.g. https://api.local:8000/api
                            'uri' => 'http://localhost:80', // Required
                            'host_config' => [
                                // Whether to replace the host if request already specifies one
                                'replace' => false,
                            ],
                        ],
                    ],
                    // Set content-type header based on request body, if the header is not already set
                    [
                        'name' => 'content_type',
                        'config' => [
                            // skip content-type detection if body is larger than size_limit
                            'skip_detection' => true,
                            // size_limit in bytes for when skip_detection is enabled
                            'size_limit' => 200000,
                        ],
                    ],
                    // Append headers to the request. If the header already exists the value will be appended to the current value.
                    [
                        'name' => 'header_append',
                        'config' => [
                            // Keys are the header names, values the header values
                            'headers' => [
                                'X-FOO' => 'bar',
                            ],
                        ],
                    ],
                    // Set header to default value if it does not exist.
                    [
                        'name' => 'header_defaults',
                        'config' => [
                            // Keys are the header names, values the header values
                            'headers' => [
                                'X-FOO' => 'bar',
                            ],
                        ],
                    ],
                    // Set headers to requests. If the header does not exist it wil be set, if the header already exists it will be replaced.
                    [
                        'name' => 'header_set',
                        'config' => [
                            // Keys are the header names, values the header values
                            'headers' => [
                                'X-FOO' => 'bar',
                            ],
                        ],
                    ],
                    // Remove headers from requests.
                    [
                        'name' => 'header_remove',
                        'config' => [
                            // List of header names to remove
                            'headers' => ['X-FOO'],
                        ],
                    ],
                    // Sets query parameters to default value if they are not present in the request.
                    [
                        'name' => 'query_defaults',
                        'config' => [
                            'parameters' => [
                                'locale' => 'en',
                            ],
                        ],
                    ],
                    [
                        // VCR replay should be placed before the VCR record
                        'name' => 'vcr_replay',
                        'config' => [
                            'fixtures_directory' => 'data/fixtures/http', // mandatory for "filesystem" player
                            'player' => 'filesystem',  // Can be filesystem, in_memory or the id of your custom player
                            'naming_strategy' => 'service_id.of.naming_strategy', // or "default"
                            'naming_strategy_options' => [
                                // options for the default naming strategy, see VCR plugin documentation
                                'hash_headers' => [],
                                'hash_body_methods' => [],
                            ],
                            'throw' => true,
                        ],
                    ],
                    [
                        'name' => 'vcr_record',
                        'config' => [
                            'fixtures_directory' => 'data/fixtures/http', // mandatory for "filesystem" recorder
                            'recorder' => 'filesystem',  // Can be filesystem, in_memory or the id of your custom recorder
                            'naming_strategy' => 'service_id.of.naming_strategy', // or "default"
                            'naming_strategy_options' => [
                                // options for the default naming strategy, see VCR plugin documentation
                                'hash_headers' => [],
                                'hash_body_methods' => [],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];
```

Clients
-------

[](#clients)

```
$client = $container->get('httplug.clients.default');
```

### Flexible Clients

[](#flexible-clients)

```
$client = $container->get('httplug.clients.default.flexible');
```

### Http Methods Clients

[](#http-methods-clients)

```
$client = $container->get('httplug.clients.default.http_methods');
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance44

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity70

Established project with proven stability

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

Recently: every ~457 days

Total

8

Last Release

480d ago

Major Versions

0.2.0 → 1.0.0-beta12020-01-23

1.0.0-beta1 → 2.0.02020-01-23

2.0.0-beta2 → 3.0.02025-01-23

PHP version history (4 changes)0.1.0PHP ^7.1

1.0.0-beta1PHP ^7.2

2.0.0-beta2PHP ^8.1

3.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6fa237583695920bbe285e738810728bfd7981ab066d39ffe852e09ae1fd30e?d=identicon)[thomasvargiu](/maintainers/thomasvargiu)

---

Top Contributors

[![thomasvargiu](https://avatars.githubusercontent.com/u/732012?v=4)](https://github.com/thomasvargiu "thomasvargiu (33 commits)")

---

Tags

httpmessagefactorylaminaszendadapterdiscoveryhttplugmezziomoduleexpressivephp-http

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thomasvargiu-httplug-module/health.svg)

```
[![Health](https://phpackages.com/badges/thomasvargiu-httplug-module/health.svg)](https://phpackages.com/packages/thomasvargiu-httplug-module)
```

###  Alternatives

[php-http/httplug-bundle

Symfony integration for HTTPlug

38921.0M54](/packages/php-http-httplug-bundle)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

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

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

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

Common HTTP Client implementations and tools for HTTPlug

1.1k225.5M571](/packages/php-http-client-common)[php-http/laravel-httplug

Laravel package to integrate the Httplug generic HTTP client into Laravel

12110.1k](/packages/php-http-laravel-httplug)[laudis/neo4j-php-client

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

184616.9k31](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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