PHPackages                             mjelamanov/psr18-guzzle - 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. mjelamanov/psr18-guzzle

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

mjelamanov/psr18-guzzle
=======================

A PSR-18 adapter for guzzle 6 client

1.7.0(9mo ago)7193.0k↓10.8%11MITPHPPHP &gt;=7.0CI failing

Since Jan 18Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/mjelamanov/psr18-guzzle)[ Packagist](https://packagist.org/packages/mjelamanov/psr18-guzzle)[ RSS](/packages/mjelamanov-psr18-guzzle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (3)Versions (10)Used By (1)

PSR-18 adapter for Guzzle 6
===========================

[](#psr-18-adapter-for-guzzle-6)

[![Build Status](https://camo.githubusercontent.com/8f936696001680c66d637a7be74d2cd643c96aa7a8328d3a0b49e3e23f5e94bd/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6d6a656c616d616e6f762f70737231382d67757a7a6c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/mjelamanov/psr18-guzzle)[![StyleCI](https://camo.githubusercontent.com/b340f074b84c9c8747d4e5fa733807379d0f6451f4c5067f12e9e2c8971e5a88/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136363235333030322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/166253002)[![Latest Stable Version](https://camo.githubusercontent.com/b67eb687bf7f8d9ab1ffc73fa5eb8731857682bd3f0e539f962919ee5461f498/68747470733a2f2f706f7365722e707567782e6f72672f6d6a656c616d616e6f762f70737231382d67757a7a6c652f762f737461626c65)](https://packagist.org/packages/mjelamanov/psr18-guzzle)[![Total Downloads](https://camo.githubusercontent.com/740df2854286e86724cbea7c95b0fa42728daf5a8c95a18b6c307450bc681544/68747470733a2f2f706f7365722e707567782e6f72672f6d6a656c616d616e6f762f70737231382d67757a7a6c652f646f776e6c6f616473)](https://packagist.org/packages/mjelamanov/psr18-guzzle)[![License](https://camo.githubusercontent.com/c27874c4f7b51ab43a2aa5d3151f153c15c13c76c78eba7c25b0eec164101cd5/68747470733a2f2f706f7365722e707567782e6f72672f6d6a656c616d616e6f762f70737231382d67757a7a6c652f6c6963656e7365)](https://packagist.org/packages/mjelamanov/psr18-guzzle)

A PSR-18 adapter for [Guzzle](https://github.com/guzzle/guzzle) 6 client.

Requirements
------------

[](#requirements)

PHP 7.0 or above.

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

[](#installation)

```
composer require mjelamanov/psr18-guzzle
```

Example
-------

[](#example)

```
require_once __DIR__ . '/vendor/autoload.php';

use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\Request;
use Mjelamanov\GuzzlePsr18\Client;

$yourOptionalConfig = [];

$guzzleClient = new GuzzleClient($yourOptionalConfig);

$client = new Client($guzzleClient); // create an adapter instance
$request = new Request('GET', 'http://example.com'); // A PSR-7 request instance

$response = $client->sendRequest($request); // Sending request

var_dump($response->getStatusCode(), (string) $response->getBody()); // Prints response
```

Error handling
--------------

[](#error-handling)

How PSR-18 clients should handle errors, see [here](https://www.php-fig.org/psr/psr-18/#error-handling). This library tries to follow to the that recommendation but Guzzle's custom handlers may break this compatibility. In this case of you can tell me through "new issue" or send me a "pull request". By default Guzzle client throws exceptions for HTTP 400 and 500 errors and this adapter is caught them and return response as is. You can disable this behavior by `http_errors` option but the result will be the same.

```
...

use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Client\RequestExceptionInterface;

...

try {
    $response = $client->sendRequest($request);
} catch (NetworkExceptionInterface $e) {
    // Network issues
} catch (RequestExceptionInterface $e) {
    // When request is invalid
} catch (ClientExceptionInterface $e) {
    // In all other cases
}
```

Test
----

[](#test)

```
composer test
```

License
-------

[](#license)

The MIT license. Read [LICENSE file](https://github.com/mjelamanov/psr18-guzzle/blob/master/LICENSE).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance58

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% 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 ~312 days

Recently: every ~464 days

Total

9

Last Release

271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cba48e48dc3912d15d8c461239e4454b33bc3ffd4ac6d183dd2fbc441540beb?d=identicon)[mjelamanov](/maintainers/mjelamanov)

---

Top Contributors

[![mjelamanov](https://avatars.githubusercontent.com/u/15931507?v=4)](https://github.com/mjelamanov "mjelamanov (29 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")

---

Tags

httphttp clientpsr-18Guzzle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mjelamanov-psr18-guzzle/health.svg)

```
[![Health](https://phpackages.com/badges/mjelamanov-psr18-guzzle/health.svg)](https://phpackages.com/packages/mjelamanov-psr18-guzzle)
```

###  Alternatives

[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.5k1.1B37.7k](/packages/guzzlehttp-guzzle)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.7M10](/packages/chargebee-chargebee-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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