Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20073

Add a pdf as an attachment for a mock response

$
0
0

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 you


Viewing all articles
Browse latest Browse all 20073

Trending Articles