I need to implement this request in Karate:
curl --location --request POST 'https:/myURL/' \
--header 'Authorization: Bearer myToken' \
--form 'csv=@"newUser.csv"'
PS: newUser.csv file is in the same folder as my feature
This is how I am sending my request on Postman:
Which will be the case when I not attached the csv file or use a file with different extension:
And this is how it looks the request on Karate logs:
It seems I am not sending anything as a body after the conversion to string
CodePudding user response:
Make this change:
* def fileContents = karate.readAsString('classpath:newUser.csv')
* multipart file csv = { value: '#(fileContents)' }