Skip to content

14448 - Document http_codes supports passing methods #14453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ will automaticaly retry failed HTTP requests.
retry_failed:
# backoff_service: app.custom_backoff
# decider_service: app.custom_decider
http_codes: [429, 500]
http_codes:
429: true
500: ['GET', 'HEAD']
max_retries: 2
delay: 1000
multiplier: 3
Expand Down Expand Up @@ -953,13 +955,13 @@ value must use the format ``['header-name' => header-value, ...]``.
http_codes
..........

**type**: ``array`` **default**: ``[423, 425, 429, 500, 502, 503, 504, 507, 510]``
**type**: ``array`` **default**: ``[0, 423, 425, 429, 500: ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'], 502, 503, 504: ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'], 507: ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'], 510: ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE']]``

.. versionadded:: 5.2

The ``http_codes`` option was introduced in Symfony 5.2.

The list of HTTP status codes that triggers a retry of the request.
The list of HTTP status codes that triggers a retry of the request. You can pass a method(s) option after a HTTP status code to only retry a request on certain method(s).

http_version
............
Expand Down