Call Web API using WEB Client in C#

Ankaprasad
Posted by Ankaprasad under C# category on | Points: 40 | Views : 1570
            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

Posted by: Myrtletran on: 3/13/2018 Level:Starter | Status: [Member] | Points: 10
nice code

Login to post response