Wednesday, October 10, 2018

How do I merely make a GET call with a WebClient in older C#?

using (WebClient webClient = new WebClient())
{
   webClient.Headers.Add("X-Venafi-Api-Key", myToken);
   byte[] response = webClient.DownloadData(myUrl + "authorize/checkvalid");
   JObject json = (JObject)JsonConvert.DeserializeObject(Encoding.UTF8
         .GetString(response));

No comments:

Post a Comment