Call Web API using WEB Client in C#

Ankaprasad
Posted by Ankaprasad under C# category on | Points: 40 | Views : 254
            string phone = Console.ReadLine();  
WebClient client = new WebClient();
client.Headers.Add("Content-Type:application/json"); //Content-Type
client.Headers.Add("Accept:application/json");
string result = client.DownloadString("http://localhost:63097/api/Search/" + phone);

Comments or Responses

Login to post response