The line starting ${headers}= Create Dictionary is missing the Content-Type: header
The line starting &{multipart_file}= Create Dictionary, ${CONTENT_TYPE} should be the file’s content type (e.g. text/plain) not the multipart/form-data content type
where 'content-type' is a string defining the content type of the given file
*** Test Cases ***
Test Upload Success
[Documentation] Test case that simulates different download scenarios
Create Session Session_download ${BASE_URL} verify=False
${headers}= Create Dictionary Authorization=Bearer ${ACCESS_TOKEN} accept=application/json Content-Type=Multipart/form-data
${file_content}= Get File ${FILE_PATH}
&{multipart_file}= Create Dictionary file=( test.txt, ${FILE_CONTENT}, text/plain)
${response}= POST On Session Session_download ${ENDPOINT_CREATE} headers=${headers} files=${multipart_file}
Should Be Equal As Numbers ${response.status_code} 200
I wasn’t sure where to guide you from here, but after thinking on it a bit, I would try running the curl command with a -v switch and saving the request headers and request body from that command and compare it to what you have from requests library
Look at the content-length header and make sure they are the same size when uploading the same file
Then check the other headers and see if any are missing or extra.
They looked a little odd to me, which made me look close and notice the & on &{multipart_files} on the POST On Session line, I think on that line it should be a $ not &, so you could try that too.