title: How to implement retry mechanism into python requests library?
body: <p>I would like to add a retry mechanism to python request library, so scripts that are using it will retry for non fatal errors.</p>
  
  <p>At this moment I do consider three kind of errors to be recoverable:</p>
  
  <ul>
  <li>HTTP return codes 502, 503, 504</li>
  <li>host not found (less important now)</li>
  <li>request timeout</li>
  </ul>
  
  <p>At the first stage I do want to retry specified 5xx requests every minute. </p>
  
  <p>I want to be able to add this functionality transparently, without having to manually implement recovery for each HTTP call made from inside these scripts or libraries that are using python-requests.</p>