What I'm trying to do:
I'm trying to practise making HTTP calls (...if that is what it's called) from a simple ASP.NET MVC web application. To do this, I am attempting to get weather details from OpenWeatherMap. You can do this by:
- Add the following parameter to the GET request: APPID=APIKEY
- Example: api.openweathermap.org/data/2.5/forecast/city?id=524901&APPID=1111111111
My understanding, from my learning:
- The controller is the one to make the above HTTP call.
My question:
- How do I actually make that HTTP GET request, in ASP.NET MVC?
HttpClientto make HTTP requests and receive responses. MVC is the front-end application host for your code, but you're talking about back-end .NET code which can be invoked from any application host.