Home > database >  'has contents that are not what they are reported to be' - Getting this error when trying
'has contents that are not what they are reported to be' - Getting this error when trying

Time:10-09

I need to make a call to an endpoint using Restassured with a JPEG(Image file) file as multipart/form-data(content type). In the postman, the call is working fine, but its not the case when I execute through my code below. Any help would be much appreciatedenter image description here

Error: enter image description here

CodePudding user response:

I think you just miss the mime-type for file upload.

RequestSpecBuilder addMultiPart(String controlName, File file, String mimeType)

You just put image/jpeg for jpeg file.

addMultiPart("file", new File(FILE_TO_UPLOAD), "image/jpeg")
  • Related