From uno platform WASM client I am trying to call a asp.net core rest demo:
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
When the wasm client calls the rest I get TypeError: Failed to fetch but this works just fine UWP and console apps.
Client is using
public async Task<string> RefreshDataAsync(string x)
{
var _client = new HttpClient();
var response = await _client.GetStringAsync(@"http://localhost:58658/weatherforecast");
return response;
}
Does WASM uno platform support rest api calls?