I want to get JSON response from Web API Call. I am calling it like below
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://myapi.proj.com/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("Authorization", "Basic TUNTRTpNQ1MhZTIwMTc=");
client.DefaultRequestHeaders.Add("ClientURL", "http://123.com");
var response = client.PostAsJsonAsync("api/name/", priceRequest).Result;
I am unable to JSON in response variable. I want to get JSON response and assign it to my class which is somewhat like below
public class Information
{
public int id{ get; set; }
public string Name{ get; set; }
public string address{ get; set; }
}