Post call for file upload not working as expected using java.I need to upload a file using rest call..The file format is correct and its working perfectly in postman and ui side also but in java its giving "Incorrect file format" as the file is not getting uploaded it seems. Am i missing any header or anything.
File file = new File("/Users/surya/Downloads/2021-06-16.xlsx");
Response response = RestAssured
.given()
.multiPart("file", file, "multipart/form-data")
.post("http://myuploadsite.com/upload/feedfile");
System.out.println(response.asString());
My postman curl request
curl --location --request POST 'http://myuploadsite.com/upload/feedfile' \
--header 'Content-Type: multipart/form-data; boundary=jena' \
--header 'Host;' \
--form 'file=@"/Users/surya/Downloads/2021-06-16.xlsx"'