PHPackages                             tommyseus/guzzlehttp-middleware - 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. tommyseus/guzzlehttp-middleware

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

tommyseus/guzzlehttp-middleware
===============================

The library provides several middleware classes for the guzzle http client.

0.1.0(7y ago)0234MITPHPPHP ^7.1

Since Nov 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tommyseus/guzzlehttp-middleware)[ Packagist](https://packagist.org/packages/tommyseus/guzzlehttp-middleware)[ Docs](https://github.com/tommyseus/guzzlehttp-middleware)[ RSS](/packages/tommyseus-guzzlehttp-middleware/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

guzzlehttp-middleware
=====================

[](#guzzlehttp-middleware)

[![Latest Stable Version](https://camo.githubusercontent.com/12736fdcbc6197ec6ebf7f754e9ba3e01fe454df63a9cb121f3d4f24e1426ccf/68747470733a2f2f706f7365722e707567782e6f72672f746f6d6d79736575732f67757a7a6c65687474702d6d6964646c65776172652f762f737461626c65)](https://packagist.org/packages/tommyseus/guzzlehttp-middleware)[![License](https://camo.githubusercontent.com/b07176445bec562035739b33d72b2c69272c0c65bb4d05680dcb9ba9909d20ff/68747470733a2f2f706f7365722e707567782e6f72672f746f6d6d79736575732f67757a7a6c65687474702d6d6964646c65776172652f6c6963656e7365)](https://packagist.org/packages/tommyseus/guzzlehttp-middleware)[![Build Status](https://camo.githubusercontent.com/9d8258261e010512acfec4ebf065da90c2367836a5eb7ec89800a79a6ccdf149/68747470733a2f2f7472617669732d63692e6f72672f746f6d6d79736575732f67757a7a6c65687474702d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tommyseus/guzzlehttp-middleware)[![Coverage Status](https://camo.githubusercontent.com/0ccab8634abcedd4254b108d04e14324a342e12f99ef9d0fce05801d363d3f13/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f746f6d6d79736575732f67757a7a6c65687474702d6d6964646c65776172652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/tommyseus/guzzlehttp-middleware?branch=master)

The library provides several middleware classes for the guzzle http client.

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

[](#installation)

### Requirements

[](#requirements)

- PHP 7.1+

### Composer installation

[](#composer-installation)

```
$ composer require tommyseus/guzzlehttp-middleware
```

Encoding Middleware
-------------------

[](#encoding-middleware)

The encoding middleware converts the response to the expected encoding. It will modify the body and the content-type header of the response. It's possible to to add the encoding middleware to the handler stack or add it to the promise-then method.

```
$stack = \GuzzleHttp\HandlerStack::create();
$stack->push(\GuzzleHttp\Middleware::mapResponse(new \Seus\GuzzleHttp\Middleware\Encoding('UTF-8')));

return new \GuzzleHttp\Client([
    'handler' => $stack,
]);
```

```
/* @var $client \GuzzleHttp\Client */

$promise = $client->requestAsync('GET', '......');
$promise->then(new \Seus\GuzzleHttp\Middleware\Encoding('UTF-8'));
$promise->then(
    function (\Psr\Http\Message\ResponseInterface $res) {
        echo $res->getStatusCode();
    }
);

$promise->wait();
```

Run tests
---------

[](#run-tests)

```
$ docker-compose run guzzlehttp-middleware-php72 composer check

$ docker-compose run guzzlehttp-middleware-php71 composer check
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2734d ago

### Community

Maintainers

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

---

Top Contributors

[![tommyseus](https://avatars.githubusercontent.com/u/637664?v=4)](https://github.com/tommyseus "tommyseus (3 commits)")

---

Tags

middlewareGuzzleencoding

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tommyseus-guzzlehttp-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/tommyseus-guzzlehttp-middleware/health.svg)](https://phpackages.com/packages/tommyseus-guzzlehttp-middleware)
```

###  Alternatives

[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43117.4M104](/packages/kevinrob-guzzle-cache-middleware)[caseyamcl/guzzle_retry_middleware

Guzzle v6+ retry middleware that handles 429/503 status codes and connection timeouts

21610.7M64](/packages/caseyamcl-guzzle-retry-middleware)[rtheunissen/guzzle-log-middleware

Guzzle middleware to log requests and responses

842.3M17](/packages/rtheunissen-guzzle-log-middleware)[eljam/guzzle-jwt-middleware

A jwt authentication middleware for guzzle 6

28722.5k3](/packages/eljam-guzzle-jwt-middleware)[rtheunissen/guzzle-rate-limiter

Guzzle 6 middleware used to delay requests dynamically

52177.2k1](/packages/rtheunissen-guzzle-rate-limiter)[brightfish/caching-guzzle

Cache HTTP responses through Guzzle middleware

1031.5k](/packages/brightfish-caching-guzzle)

PHPackages © 2026

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