Below is my API code where I am trying to update the file path on a daily basis to run an API call.
I am unable to determine how I can update the file name on a daily basis. Some help would be highly appreciated.
import requests
url = "*******"
payload = {'Content-Disposition': 'form-data',
'Content-Type': 'text/plain',
'name': 'file'}
files = [
('file', open('/C:/Users/SET/Desktop/TEST/TEST/test_test_test_file_20201001.csv','rb'))
]
headers = {
'Content-Type': 'multipart/form-data',
'X-API-TOKEN': '*******'
}
response = requests.request("POST", url, headers=headers, data = payload, files = files)
print(response.text.encode('utf8'))