cancel
Showing results for 
Search instead for 
Did you mean: 

I have a rest response in which PDF is being returned. How to save it to my local disk as pdf?

Occasional Contributor

I have a rest response in which PDF is being returned. How to save it to my local disk as pdf?

Hi, 

 

I am getting a pdf in the response of a rest call. Which is displayed as encrypted in the raw response. I wanted to store that file to my local disk and email it . If I compare it with a soap service, I could see that in soap service, the pdfs are coming in the response as attachments in response and I can click on the attachment and save it to my local. I am looking for a way to do the same from a rest response as well. This may be  very basic question for the experst out here .

 

Thanks

Bimal

3 REPLIES 3
Staff

Re: I have a rest response in which PDF is being returned. How to save it to my local disk as pdf?

hi, Bimal

May I know what's your response format? Is that JSON or XML. Under those two response editors you can see the attachments tab. Does that tab contains your PDF documents?

Regards,
/Li
Occasional Contributor

Re: I have a rest response in which PDF is being returned. How to save it to my local disk as pdf?

Hi, 

 

Thanks for the response.I have replied in detail from my company email.

 

Thanks

Bimal

Contributor

Re: I have a rest response in which PDF is being returned. How to save it to my local disk as pdf?

Hi

I had similar situation. Thought would share it with other members. I  have a script whcih retuns pdf in binary form. So in test case properties I uses dump to give thes path and file name like C:/test.pdf 

My get request has at the end '?format=pdf' so when I created brand new test case it added format parameter with pdf .

I think if it is not there you can add parameter format with value pdf.  To save it as pdf 

I had a little hard time as I cloned my old 'Get...' test case and tried to save it as pdf. It saved the response as pdf but the file was corrupted. 

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors