https://github.com/totaro/httpclientdemoapp
HttpClient REST API calls - C# ASP.NET MVC Blazor/Razor pages - Demo Hub for different coding experiments: HttpClientDemo
https://github.com/totaro/httpclientdemoapp
asp-net asp-net-mvc csharp httpclient razor-pages rest-api
Last synced: 1 day ago
JSON representation
HttpClient REST API calls - C# ASP.NET MVC Blazor/Razor pages - Demo Hub for different coding experiments: HttpClientDemo
- Host: GitHub
- URL: https://github.com/totaro/httpclientdemoapp
- Owner: totaro
- Created: 2022-02-10T14:47:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-13T13:42:38.000Z (over 4 years ago)
- Last Synced: 2025-03-12T14:15:27.370Z (over 1 year ago)
- Topics: asp-net, asp-net-mvc, csharp, httpclient, razor-pages, rest-api
- Language: HTML
- Homepage:
- Size: 327 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HttpClientDemoApp
Demo Hub for different coding experiments: HttpClientDemo
C#/ASP.NET MVC Blazor/Razor pages
.NET 6.0 framework
using NuGet Package: System.Net.Http.Json 6.0.0
HttpClient REST API for 2 different calls:
- 5 days weatherforecast (weather state, daily low/high degrees) for Helsinki, Finland from https://www.metaweather.com/api/location/565346/
Models:
\HttpClientDemo\Models\WeatherForecastModel.cs
\HttpClientDemo\Models\DayForecastModel.cs
Page/HttpClient:
\HttpClientDemo\Pages\WeatherData.razor (try..catch response)
BaseAddress configuration for weatherdata (\HttpClientDemo\Startup.cs)
string uri = Configuration.GetValue("MetaAPI");
services.AddHttpClient("meta", c =>
{
c.BaseAddress = new Uri(uri);
});
BaseAddress name configuration (\HttpClientDemo\appsettings.json)
"MetaAPI": "https://www.metaweather.com/api/"
-------------------------------------------------------------------------------------
- Current Bitcoin value (Euro, USD, GBP and JPY) currencies with 24 hours volume and change from https://api.coingecko.com/api/
Model:
\HttpClientDemo\Models\CryptoCurrentModel.cs
Page/HttpClient:
\HttpClientDemo\Pages\CryptoData.razor (if..else response)
