[HttpGet] [ActionName("test_api")] public string test_api(ret request) { return "nesreen"; }
public static string callapi() { HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:52559/"); //client.DefaultRequestHeaders.Add("appkey", "myapp_key"); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = client.GetAsync("api/test").Result; if (response.IsSuccessStatusCode) { // i want here to extract the string that returned from my api } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)