1-) C# - Ders 22
1-) ilk once metot yazılır
[HttpPost]
public ActionResult Index(string city)
{
string api = "7056874dbb5c7ebfcc588e8a1e1e8ace";
string conn = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&lang=tr&units=metric&appid=" + api;
Api2 api2 = new Api2();
string json = api2.requestGet(conn);
Root WeatherList = JsonConvert.DeserializeObject<Root>(json);
if (WeatherList == null)
return null;
}
ViewBag.Message = WeatherList;
return View();
2-) sonra bu kod yazılır
C# - Ders 1 (roketnot.com)