Closed msabramo closed 5 years ago
e.g.:
from requests.packages.urllib3.util.retry import Retry import requests_unixsocket sess = requests_unixsocket.Session() HTTP_REQUEST_RETRIES = 3 HTTP_RETRY_BACKOFF_FACTOR = 0.3 HTTP_RETRY_FORCELIST = (404, 500, 502, 504) retry = Retry(total=HTTP_REQUEST_RETRIES, read=HTTP_REQUEST_RETRIES, connect=HTTP_REQUEST_RETRIES, backoff_factor=HTTP_RETRY_BACKOFF_FACTOR, status_forcelist=HTTP_RETRY_FORCELIST) adapter = requests_unixsocket.UnixAdapter(max_retries=retry) sess.mount('http+unix://', adapter) print(sess.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/this-does-not-exist'))
Fixes: GH-37
Cc: @fantamiracle, @keith-bennett-gbg
Thank you!
(finally) released in https://pypi.org/project/requests-unixsocket/0.3.0/
e.g.:
Fixes: GH-37
Cc: @fantamiracle, @keith-bennett-gbg