PHPackages                             oat-sa/lib-correlation-ids-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. oat-sa/lib-correlation-ids-guzzle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

oat-sa/lib-correlation-ids-guzzle
=================================

OAT Correlation Ids Guzzle Library

v0.4.0(1y ago)08.8k↓75.3%1GPL-2.0-onlyPHPPHP ^7.1.3 || ^8.0CI failing

Since Nov 6Pushed 1y ago40 watchersCompare

[ Source](https://github.com/oat-sa/lib-correlation-ids-guzzle)[ Packagist](https://packagist.org/packages/oat-sa/lib-correlation-ids-guzzle)[ RSS](/packages/oat-sa-lib-correlation-ids-guzzle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (3)Versions (10)Used By (0)

Correlation Ids Guzzle Middleware Library
=========================================

[](#correlation-ids-guzzle-middleware-library)

> PHP library for correlation ids guzzle middleware based on the [correlation ids library](https://github.com/oat-sa/lib-correlation-ids).

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Principles](#principles)
- [Usage](#usage)
- [Tests](#tests)

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

[](#installation)

```
$ composer require oat-sa/lib-correlation-ids-guzzle
```

Principles
----------

[](#principles)

This library provides a ready to use [guzzle](http://docs.guzzlephp.org/en/stable/) middleware that forwards, as request headers, the correlation ids fetched from the [correlation ids registry](https://github.com/oat-sa/lib-correlation-ids/blob/master/src/Registry/CorrelationIdsRegistryInterface.php).

**Notes**

- the current process correlation id will be forwarded as the parent one,
- the root correlation id will be also forwarded.

More details about calls chaining available on the [correlation ids library](https://github.com/oat-sa/lib-correlation-ids) documentation.

Usage
-----

[](#usage)

### With the provided factory

[](#with-the-provided-factory)

The `GuzzleClientFactory` creates for you a guzzle client with the middleware already enabled:

```
