I want to download a binary file via an URL on my UWP app (HoloLens). In the editor everything works fine with either WebClient.DownloadData or a WebRequest, but those don't work in UWPs. I think the best option is to use UnityWebRequest (is it?), but I'm not sure how to proceed.
If I create a UnityWebRequest.Get to an URL, how could I pass the retrieved contents to a Stream or MemoryStream class?
This is what I want to do:
var request = UnityWebRequest.Get(url); var response = .....? // How do I get the response? var stream = // And cast it to a stream? using (var binaryStream = new BinaryReader(stream) { DoStuff(); }
If I create a UnityWebRequest.Get to an URL, how could I pass the retrieved contents to a Stream or MemoryStream class?
This is what I want to do:
var request = UnityWebRequest.Get(url); var response = .....? // How do I get the response? var stream = // And cast it to a stream? using (var binaryStream = new BinaryReader(stream) { DoStuff(); }