{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://ws.spk.gov.tr/PortfolioValues/api/Funds/2");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
fonBilgileri fon = null;
HttpResponseMessage response = await client.GetAsync("PortfolioValues/api/Funds/2");
if (response.IsSuccessStatusCode)
{
fon = await response.Content.ReadAsAsync<fonBilgileri>();
}
return View(fon);
}
}
iyi günler, c# ile bir web servisten get isteği yaptığım zaman bu hatayı alıyorum.
//https://ws.spk.gov.tr/PortfolioValues/api/Funds/2
public async Task<ActionResult> FonBilgileri()
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://ws.spk.gov.tr/PortfolioValues/api/Funds/2");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
fonBilgileri fon = null;
HttpResponseMessage response = await client.GetAsync("PortfolioValues/api/Funds/2");
if (response.IsSuccessStatusCode)
{
fon = await response.Content.ReadAsAsync<fonBilgileri>();
}
return View(fon);
}
}
iyi günler, c# ile bir web servisten get isteği yaptığım zaman bu hatayı alıyorum.
//https://ws.spk.gov.tr/PortfolioValues/api/Funds/2
public async Task<ActionResult> FonBilgileri()
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://ws.spk.gov.tr/PortfolioValues/api/Funds/2");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
fonBilgileri fon = null;
HttpResponseMessage response = await client.GetAsync("PortfolioValues/api/Funds/2");
if (response.IsSuccessStatusCode)
{
fon = await response.Content.ReadAsAsync<fonBilgileri>();
}
return View(fon);
}
}
Toplam 0 cevap