Unable to Upload Images Using RequestsLibrary

I’m trying to upload files thru API. Here’s the test:

Verify Updating Property Media and Text
## Add Property Media & Text
${id} Get File ${CURDIR}\resources\sales_property_id.txt
${params} Create Dictionary text=


${response} Put On Session auto_test api/crm-lifecycle/short-description/${id} json=${params}
Status Should Be OK ${response}
## Add Full Description
${response} Put On Session auto_test api/crm-lifecycle/full-description/${id} json=${params}
Status Should Be OK ${response}
# Add Property Image
${file} Get File For Streaming Upload ${CURDIR}\resources\kitchen_dining_img.jpg
${response} Post On Session auto_test api/crm-lifecycle/${id}/media/1 data=${file}

I get an error when running this code:

body={“statusCode”:0,“httpResponseCode”:400,“errors”:[{“code”:1,“description”:“Incorrect Content-Type: application/json”}],“warnings”:,“data”:null}

If I try to put Content-Type=multipart/form-data; boundary=------WebKitFormBoundaryxgeShLB6zwkCApRC, it still doesn’t work.

How do I get this to work?

you are trying to upload a file with content-type application/json and your backend responds with: Incorrect Content-Type: application/json

POST On Session keyword document refers:

Other optional requests arguments can be passed using **kwargs see the GET keyword for the complete list.

On the GET section;

Other optional requests arguments can be passed using **kwargs here is a list:

On files row:

Dictionary of file-like-objects (or {'name': file-tuple}) for multipart encoding upload. file-tuple can be a 2-tuple ('filename', fileobj), 3-tuple ('filename', fileobj, 'content_type') or a 4-tuple ('filename', fileobj, 'content_type', custom_headers), where 'content-type' is a string defining the content type of the given file and custom_headers a dict-like object containing additional headers to add for the file.

Instead of passing data, fix might be to use files with the 3-tuple filename, fileobj and content-type ?

It seems I am wrongly passing tuple into files= or someting like that

Upload Video File
    ${VideoFile}=  Set Variable  ${CURDIR}${/}upload${/}small.mp4
    ${header}    Create Dictionary    Accept=*/*    Authorization=Bearer ${access_token}
    ${custom_headers}    Create Dictionary    Id=12    ChunkNumber=1
    ${my_list}=    Create List    small.mp4    ${VideoFile}    video/mp4    ${custom_headers}
    ${my_tuple}=  Evaluate    tuple(${my_list})
    ${response}    PUT    https://hostname/api/MultipartUploads    files=${my_tuple}    headers=${header} 

It returns error ValueError: too many values to unpack (expected 2)
Do you see what I do wrong? Thank you