Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

UnityWebRequest Response to Stream

$
0
0
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(); }

Viewing all articles
Browse latest Browse all 387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>