Skip to content

Commit c01aa51

Browse files
committed
Update documentation on custom HTTP clients
1 parent d7928e7 commit c01aa51

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/http.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ define your ``MyCustomHTTPClient`` class as follows:
1818
1919
from __future__ import absolute_import, unicode_literals
2020
21-
from requests.packages.urllib3.util import Retry
2221
from requests.adapters import HTTPAdapter
2322
from requests import Session, exceptions
2423
@@ -28,11 +27,9 @@ define your ``MyCustomHTTPClient`` class as follows:
2827
2928
class MyCustomHTTPClient(BaseHTTPClient):
3029
31-
def __init__(self, max_retries=5):
30+
def __init__(self, retries=5):
3231
self._session = Session()
33-
self._session.mount('https://', HTTPAdapter(
34-
max_retries=Retry(total=max_retries, status_forcelist=[500])
35-
))
32+
self._session.mount('https://', HTTPAdapter(max_retries=retries))
3633
self._check_cert = False
3734
3835
def head(self, url, params=None, headers=None, auth=None):
@@ -153,7 +150,7 @@ Then you would inject your HTTP client as shown below:
153150
client = ArangoClient(
154151
username='root',
155152
password='',
156-
http_client=MyCustomHTTPClient(max_retries=10),
153+
http_client=MyCustomHTTPClient(retries=10),
157154
use_session=True, # This flag (used in the default client) is now ignored
158155
check_cert=True # This flag (used in the default client) is now ignored
159156
)

0 commit comments

Comments
 (0)