Forum Discussion

woodced's avatar
woodced
Copper Contributor
Nov 24, 2021

Serve Byte Data within Blazor-MAUI?

How can I serve custom byte data internally within a Blazor-MAUI desktop app?

 

For instance, I want to serve images that are generated dynamically within the app (ie not by an external web-service) based on some weather-criteria. How would I go about doing this?

For e.g. imagine a weather image based on some data:

 

<img src="/img-generator-service?data=576587" />

How would I instantiate a service in the MAUI app that would mimic a webserver serving bytes to localhost?

 

e.g. to host something like:

public async Task<byte[]> ImgGeneratorService(string data);
//Or in the asp.net core pattern:
[HttpGet("img-generator-service")
public async Task<IActionResult> Get(string data);

 

No RepliesBe the first to reply

Resources