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

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

mikeevstropov/guzzle
====================

Retrying behavior for Guzzle

1.0.0(8y ago)017MITPHP

Since Jul 7Pushed 8y ago1 watchersCompare

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

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

mikeevstropov/guzzle
====================

[](#mikeevstropovguzzle)

Retrying behavior for [Guzzle](https://packagist.org/packages/guzzlehttp/guzzle)

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

[](#installation)

Add dependency [mikeevstropov/guzzle](https://packagist.org/packages/mikeevstropov/guzzle)

```
$ composer require mikeevstropov/guzzle
```

New options
-----------

[](#new-options)

- **requests\_limit**

    Accepts:

    - `integer` - positive integer

    Default:

    - `1` - only one attempt

    *Maximum number of attempts to receive a response.*
- **repeat\_on**

    Accepts:

    - `array` - array with a numeric index

    Default:

    - `array(0, 5)` - repeat failed request or if response code is 5xx

    *List of error codes for retrying requests:*

    - `array(5)` - on `GuzzleHttp\Exception\ServerException` (5xx code)
    - `array(4)` - on `GuzzleHttp\Exception\ClientException` (4xx code)
    - `array(0)` - other `TransferException` like `GuzzleHttp\Exception\ConnectException`

    *You can combine it like `array(4, 5).`*

Usage
-----

[](#usage)

```
