Add a pdf as an attachment for a mock response
I am reading a file from my system and i need to send it as a pdf attachment in my mock response. I am using ready api. Can any body give me advice please? I have tried the below code and when the request is made, the pdf is downloaded but it fails to load it on the browser. String filename='C:/soapui.log' File file = new File(filename); def headers = mockResponse.responseHeaders headers["Content-Type"]=["application/pdf"] headers["Content-Disposition"]=["attachment.pdf"] mockResponse.responseHeaders=headers How do i return a file as a pdf,which i am reading in from my system Any suggestions please? Thank youSolved10KViews0likes8Comments