mardi 1 mai 2018

Karate api post gives 406 error

I was trying to use karate with the following to upload a csv file:

Given url 'some_url'
And multipart entity read('classpath:some_file.csv')
And header Content-Type='text/csv'
When method POST
Then status 200

When I run this scenario I get 406 with the following error message:

"Un-Acceptable format, Content-Type must be one of those listed in \"formats\" but you sent \"text/csv; boundary=boundary_1_1525198892237\"","formats":["text/csv","text/plain","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json","application/xml","application/vnd.oasis.opendocument.spreadsheet"]

Is there anything wrong with the syntax?

Aucun commentaire:

Enregistrer un commentaire