How to wait for a POST request (requests.post) completion in Python?
<p>I'm using the requests library in Python to do a POST call.
My POST call takes about 5 minutes to be completed. It will create a file in a S3 bucket.
After that, I want to download this file. However, I need to create an extra logic to wait for my POST to finish before executing the next line on my code to download the file.</p>

<p>Any suggestions?</p>

<p>Is it possible to use the subprocess library for this? If so, how would be the syntax?</p>

<p>Code:</p>

<pre><code>import requets
r = requests.post(url)
# wait for the post call to finish
download_file(file_name)
</code></pre>