Cześć,
próbuję w aplikacji Blazor pobrać kurs waluty ze strony NBP ( http://api.nbp.pl/ ), niestety wywala mi wyjątek: "TypeError: NetworkError when attempting to fetch resource.".
Kod jest następujący:
public class Rate
{
public string no { get; set; }
public string effectiveDate { get; set; }
public double mid { get; set; }
}
public class Nbp
{
public string table { get; set; }
public string currency { get; set; }
public string code { get; set; }
public List<Rate> rates { get; set; }
}
//...
var test = await Http.GetFromJsonAsync<Nbp>(new Uri("http://api.nbp.pl/api/exchangerates/rates/A/EUR/2020-12-15/?format=json")); //tutaj próbowałem wielu różnych opcji
Czy może mnie ktoś naprowadzić gdzie robię błąd?
Z góry dziękuję za pomoc.