@@ -735,16 +735,16 @@ Retry over different uris
735
735
.........................
736
736
737
737
When using a ``RetryableHttpClient ``, the ``base_uri `` can be set as an array of
738
- uris. The array will be used in the given order, meaning that the first request
739
- will be made with the first uri in the array. Should it fail, the next one will
738
+ uris. The array will be used in the given order, meaning that the first request
739
+ will be made with the first uri in the array. Should it fail, the next one will
740
740
be used for the first retry. If the number of configured retries is greater than
741
741
the number of given uris, the last uri will be used for every exceding retry.
742
742
743
743
You can pass the array of base uris directly to the ``request `` method or when
744
744
creating a HttpClient with the ``withOptions `` method::
745
745
746
746
use Symfony\Component\HttpClient\RetryableHttpClient;
747
-
747
+
748
748
$client = new RetryableHttpClient(HttpClient::create());
749
749
750
750
$response = $client->request('GET', 'some-path', [
@@ -764,13 +764,13 @@ creating a HttpClient with the ``withOptions`` method::
764
764
765
765
$response = $client->request('GET', 'some-path');
766
766
767
- If you wish some or all of the base uris to be shuffled, you can pass a nested
768
- array inside the ``base_uri `` array. Every uri inside the nested array will be
769
- randomized, and the order of the base uris outside this nested array will be
767
+ If you wish some or all of the base uris to be shuffled, you can pass a nested
768
+ array inside the ``base_uri `` array. Every uri inside the nested array will be
769
+ randomized, and the order of the base uris outside this nested array will be
770
770
preserved::
771
771
772
772
use Symfony\Component\HttpClient\RetryableHttpClient;
773
-
773
+
774
774
$client = new RetryableHttpClient(HttpClient::create());
775
775
776
776
$response = $client->request('GET', 'some-path', [
@@ -780,7 +780,7 @@ preserved::
780
780
// base uri passed inside a nested array will be shuffled
781
781
'http://example.com/b/',
782
782
'http://example.com/c/',
783
- ]
783
+ ],
784
784
// the order of the non-nested base uris is preserved
785
785
'http://example.com/d/',
786
786
],
0 commit comments