Question
The Bank of Nova Scotia
CA
Last activity: 18 Jun 2022 13:01 EDT
RestClient response with pdf
I am connecting to a Rest API that returns a PDF document in its response. Using C# code I'm able to download the pdf from the IRestResponse RawBytes method. Code sample below:
IRestResponse response = client.Execute(request);
using (BinaryWriter writer = new BinaryWriter(File.Open(@"c:\temp\abc.pdf", FileMode.Create))) { writer.Write(response.RawBytes); }
However using the Pega Rest Client component the response is a string object and returns some other characters. Is there a way to download the document using the Pega component?