I want to delete files from the server using the Pycurl or Python request method. I have a list of file names and I want to delete all files from OVH server by comparing name with the List items. I am using OVH cloud API.
this is the code for delete one file from the server. I want to delete multiple files. how do do this ?
file_path = '/home/u_file.txt'
url url ='https://'+OVH_ENDPOINT+'+filename
headers = {
'content-type': "multipart/form-data; boundary=----
WebKitFormBoundary7MA4YWxkTrZu0gW",
'X-Auth-Token': ""+ovhToken+"",
'Cache-Control': "no-cache"
}
r = requests.delete(url, headers=headers)
n = os.write(sys.stdout.fileno(), r.content)