I need to upload a tar.gz file using python requests. When i try to check the payload in browser network tab i could see payload as below
------WebKitFormBoundary3sUg1Lq9ivT71NNI
Content-Disposition: form-data; name="file"; filename="cop-pem-cert.tar.gz"
Content-Type: application/gzip
------WebKitFormBoundary3sUg1Lq9ivT71NNI--
Any thoughts what should be the payload and headers to be used ? Tried this but getting 400
import requests
url='https://test.athena.com/data-migration/upload'
headers={'referer': 'https://test.athena.com', 'cookie': 'i18next=; session=3c97e9d692670f6a_621662a4.JQXBkMr0-bDZiU2G4dZpoNP8m4A; csrftoken=##39d1b4f0a4b32898623f82c0033f1ebaa04ebd4d; hpeuck_cktst=','x-csrf-token':'##39d1b4f0a4b32898623f82c0033f1ebaa04ebd4d','X-Requested-With': 'XMLHttpRequest','Content-Type': 'application/gzip'}
a=requests.post(url,headers=headers,files={'file': ('cop-pem-cert.tar.gz', open('cop-pem-cert.tar.gz', 'rb'))})