3
Answers

Cannot convert from string to RestSharp.IRestRequest

Ramco Ramco

Ramco Ramco

2y
1.6k
1

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)