how to send request to visa api with python
02:34 11 Jul 2024

I'm trying to send post requests to visa api with python-requests. I succeeded in sending through visa developer center playground and it's working. but doin it with python not working.
my code:

url = "https://sandbox.api.visa.com/filedeliveryservice/v1/binFileTransfer"
request_body = {
    "requestHeader": {
        "requestTS": "2017-02-15T22:05:00.000",
        "requestMessageId": "testAnna"
    },
    "requestData": {"fileName": "VBASS_TR_LEVEL3_03262024_3.csv"}
}
r = requests.post(url,
                  cert=(client_cert, client_key),
                  auth=(user_id, password),
                  data=json.dumps(request_body),
                  timeout=10
                  )

the response:

b'{"timestamp":"2024-07-11T06:09:10.260+00:00","status":415,"error":"Unsupported Media Type","path":"/CDISI_VBASS/services/v1/binFileTransfer"}'

what is i am doing wrong, i have no idea yet.
is it even right way to send request? i can't find any valid source on this theme on internet

python-requests visa-api