Forum Discussion

danielatsi's avatar
danielatsi
New Contributor
7 years ago

Problem with content-type when attaching file to SoapUI rest request

Hello,

can somebody help me with the following issue that I have when trying to attach a file to Rest Post request?

 

I want to attach a .png file to my rest request in SoapUI free version, the problem is that SoapUI puts in the Raw of the request Content-Type: image/x-png instead of image/png

 

It looks like this in the Raw tab:

 

Content-Type: image/x-png
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="energy.png"; filename="energy.png"

 

and my server is expecting content-type image/png, for which reason I am getting error: errorMessage": "File must be in one of the following formats: [image/png]

 

I have a QUERY parameter in my request with value file:filename, where filename is the complete path to the file on the local hard drive (that was the way to avoid appending the file name together with file type in the Content-type in Raw)

 

Thank you!

 

4 Replies