Hello,
I'm dealing with a web API that returns an array of raw bytes.
Is there any way to do this through the existing C# functionality?
For instance, your standard way of querying a webserver within an application,
WebClient, has this ability in .NET's library, via UploadData and DownloadData and their variants.
That functionality looks like it's not implemented yet in the cshtml libraries, where the WebClient only has the ability to deal with strings.
Is there a way to access a less abstracted web client like HttpWebRequest?
If it's not possible purely through C#, is there a way to share variables through C# and JS?
I'm going to try doing this by getting the data in javascript, and passing it to a C# function that is expecting an object, then casting that to a byte[].
Even if this works, it just feels super hacky.
I just want to know if someone is aware of a more elegant solution to this.