@@ -731,8 +731,8 @@ The ``RetryableHttpClient`` uses a
731
731
decide if the request should be retried, and to define the waiting time between
732
732
each retry.
733
733
734
- Retry Over Different URIs
735
- .........................
734
+ Retry Over Several Base URIs
735
+ ............................
736
736
737
737
.. versionadded :: 6.3
738
738
@@ -743,12 +743,12 @@ feature provides increased flexibility and reliability for making HTTP
743
743
requests. Pass an array of base URIs as option ``base_uri `` when making a
744
744
request::
745
745
746
- $response = $client->request('GET', 'foo-bar ', [
746
+ $response = $client->request('GET', 'some-page ', [
747
747
'base_uri' => [
748
748
// first request will use this base URI
749
- 'http ://example.com/a/',
749
+ 'https ://example.com/a/',
750
750
// if first request fails, the following base URI will be used
751
- 'http ://example.com/b/',
751
+ 'https ://example.com/b/',
752
752
],
753
753
]);
754
754
@@ -758,15 +758,15 @@ last base URI will be used for the remaining retries.
758
758
If you want to shuffle the order of base URIs for each retry attempt, nest the
759
759
base URIs you want to shuffle in an additional array::
760
760
761
- $response = $client->request('GET', 'foo-bar ', [
761
+ $response = $client->request('GET', 'some-page ', [
762
762
'base_uri' => [
763
763
[
764
764
// a single random URI from this array will be used for the first request
765
- 'http ://example.com/a/',
766
- 'http ://example.com/b/',
765
+ 'https ://example.com/a/',
766
+ 'https ://example.com/b/',
767
767
],
768
768
// non-nested base URIs are used in order
769
- 'http ://example.com/c/',
769
+ 'https ://example.com/c/',
770
770
],
771
771
]);
772
772
@@ -780,8 +780,8 @@ You can also configure the array of base URIs using the ``withOptions()``
780
780
method::
781
781
782
782
$client = $client->withOptions(['base_uri' => [
783
- 'http ://example.com/a/',
784
- 'http ://example.com/b/',
783
+ 'https ://example.com/a/',
784
+ 'https ://example.com/b/',
785
785
]]);
786
786
787
787
HTTP Proxies
0 commit comments