I am working with an ASP .NET Web API where the POST function of the API is returning a byte array like so in the C# code:
return Ok(outputStream.ToArray());
Where outputStream is of type System.IO.MemoryStream and the ToArray() is returning a byte array.
This function is returning a PDF stream that I want to display to the users in their browser or at least let them save it.
I've ran across a JavaScript example from Stack Overflow that shows how to get a Blob from a Base64 encoded string and display it and I was able to get it working when the API returned a Base64 encoded string; however, I wasn't able to get it working when the API was return the byte array as shown before.
May I get some code examples of how to get it working when the API is returning a byte array?