Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.5k

Cannot convert from string to RestSharp.IRestRequest

Jan 13 2023 3:27 PM

Hi

  Getting above error on this line - byte[] bytes5 = client.DownloadData(s);

dynamic json = JsonConvert.DeserializeObject(response.Content);
            string pdf = json.data;
 
            string s = pdf;
 
            int idx = s.LastIndexOf('/');
            string fileName = s.Substring(idx + 1);
            using (var client5 = new System.Net.WebClient())
            {
                byte[] bytes5 = client.DownloadData(s);
                File.WriteAllBytes(Server.MapPath("~/App_Data/") + fileName, bytes5);
            }

Thanks


Answers (3)