using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
dynamic request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://www.diyanet.gov.tr/PrayerTime/PrayerTimesSet");
dynamic data = System.Text.Encoding.ASCII.GetBytes("{countryName: \"2\", stateName: \"552\", name: \"9676\"}");
request.Method = "POST";
request.ContentType = "application/json; charset=UTF-8";
request.ContentLength = data.Length;
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0";
using (System.IO.Stream stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
dynamic cevap = (System.Net.HttpWebResponse)request.GetResponse();
dynamic cevapString = new System.IO.StreamReader(cevap.GetResponseStream()).ReadToEnd();
dynamic jsons = Newtonsoft.Json.JsonConvert.DeserializeObject<VakitElemanlari>(cevapString);
Response.Write("Aksam : " + jsons.Aksam);
Response.Write("<br>");
Response.Write("Yatsı :" + jsons.Yatsi);
}
}
public class VakitElemanlari
{
public string Imsak { get; set; }
public string Gunes { get; set; }
public string Ogle { get; set; }
public string Ikindi { get; set; }
public string Aksam { get; set; }
public string Yatsi { get; set; }
public string NextImsak { get; set; }
public string MoonSrc { get; set; }
public string HicriTarih { get; set; }
public string MiladiTarih { get; set; }
public string RumiTarih { get; set; }
public string Enlem { get; set; }
public string KibleAcisi { get; set; }
public string UlkeAdi { get; set; }
public string SehirAdi { get; set; }
public string KibleSaati { get; set; }
public string GunesBatis { get; set; }
public string GunesDogus { get; set; }
public string ItemId { get; set; }
}