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
Sachin SinghPosted Jan 13, 2023, 3:35 PM
test this
Sachin SinghPosted Jan 13, 2023, 3:59 PM
client to client5
client5 is an instance of webclient but client is an instance of RestSharp.
Ramco RamcoPosted Jan 13, 2023, 3:55 PM
Hi Sachin
what is the difference between the 2 codes
Thanks