I am getting a HTTPError: 400 Client Error: Bad Request for url ; when I run the following robot test case which aims to automate POST api. I have no issue when I run the api via postman by uploading an xlsx file in the body then running the api
*** Settings ***
Library RequestsLibrary
Library OperatingSystem
Library Collections
*** Variables ***
${API_URL} https://xxxxxxxxxxxxxxxxxxxxx.net
${FILE_PATH} path-to-my-file/products.xlsx
*** Test Cases ***
Upload XLSX File Test
[Documentation] Upload XLSX file with parameters and verify 201 response
${file}= Get File For Streaming Upload ${FILE_PATH}
${files}= Create Dictionary file=${file} operator_format=false Content-Type=multipart/form-data
${headers}= Create Dictionary Authorization=xxxxxxxxxxxxxxxxxxxxxxxxxxx Accept=application/json Content-Type=multipart/form-data
Create Session mySession ${API_URL} verify=false
${response}= POST On Session mySession /api/products/imports headers=${headers} data=${files}
Should Be Equal As Strings ${response.status_code} 201