|
|
|
|
Text only
|
21 lines
|
21 sloc
|
0.788 kB
  1.         retry = Retry( 
  2.             total=None,  # Set to None to remove this constraint and fall back on other counts. None was removed in 2.4 
  3.             connect=5, 
  4.             read=None, 
  5.             redirect=3, 
  6.             status=5, 
  7.             method_whitelist=['GET'], 
  8.             backoff_factor=0, 
  9.             raise_on_status=True, 
  10.             respect_retry_after_header=False, 
  11.             status_forcelist=[413, 429, 500, 501, 502, 503, 504] 
  12.         http = urllib3.ProxyManager( 
  13.             'http://127.0.0.1:8080', 
  14.             maxsize=10, 
  15.             retries=retry 
  16.         try: 
  17.             resp = http.request('GET', "https://httpstat.us/429", retries=retry) 
  18.         except Exception, e: 
  19.             logger.error("exception in get: "+str(e))