mardi 11 juin 2019

How to call Web Api in Console Application using Query string Param

I have parameter's In my Query string so i need to pass like below given url

URL + ?dd=&accessKey=ddfr54r5g5r

WebClient webClient = new WebClient(); webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); string url = "URL + ?dd=&accessKey=ddfr54r5g5r"; var jsonData = webClient.DownloadData(url); DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(RootObject)); RootObject obj = new RootObject(); obj = (RootObject)ser.ReadObject(new MemoryStream(jsonData));

Share Some Method which will be Working for your api.




Aucun commentaire:

Enregistrer un commentaire