How to make python .post() requests to retry?
<p>I'm trying to implement requests retry in Python.<br>
It works like charm with <code>.get()</code> requests, but a <code>.post()</code> request never retries, regardless of a status code. I'd like to use it with <code>.post()</code> requests.</p>

<p>My code:</p>

<pre><code>from requests.packages.urllib3.util import Retry
from requests.adapters import HTTPAdapter
from requests import Session, exceptions

s = Session()
s.mount('http://', HTTPAdapter(max_retries=Retry(total=2, backoff_factor=1, status_forcelist=[ 500, 502, 503, 504, 521])))
r = s.get('http://httpstat.us/500')
r2 = s.post('http://httpstat.us/500')
</code></pre>

<p>So, the <code>.get()</code> requests do retry and the <code>.post()</code> ones do not.</p>

<p>What's wrong?</p>