Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

mock document/pdf file as a response object

I am trying to return pdf / docx file as mock response object, is there any implementation for this once the user hit the url pdf will be downloaded fro mock response.

0 1 1,790
1 REPLY 1

I think you need to add extra headers to response, and your mock body is the actual string of the pdf

ContentType="application/pdf";
Content-Disposition="attachment;filename="file.pdf""