get filename from requests python code example

Example 1: filename requests python

# headers of a binary file that accepts downloading partial files
{'Server': 'VK', 'Date': 'Wed, 29 Jan 2020 11:47:20 GMT', 'Content-Type': 'application/pdf', 'Content-Length': '9713036', 'Connection': 'keep-alive', 'Last-Modified': 'Mon, 20 Jan 2020 13:01:17 GMT', 'ETag': '"5e25a49d-94358c"', 'Accept-Ranges': 'bytes', 'Expires': 'Wed, 05 Feb 2020 11:47:20 GMT', 'Cache-Control': 'max-age=604800', 'X-Frontend': 'front632904', 'Access-Control-Expose-Headers': 'X-Frontend', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Access-Control-Allow-Origin': '*', 'Strict-Transport-Security': 'max-age=15768000'}

Example 2: filename requests python

# Fetch Filename from a python request
import requests
r = requests.get(url)
r.headers['content-disposition']