Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 527.1k

Invalid Arguments

Jan 16 2023 9:43 AM

Hi


  It is giving error NimbusAPi.shipping.root has some Invalid arguments. In response below data is returned

{"status":true,"data":"htts:\/\/nimubs-assets.s3.amazonaws.com\/manifest\/20230116150815-95.pdf"}

dynamic json = JsonConvert.DeserializeObject(response.Content);

JavaScriptSerializer serializer = new JavaScriptSerializer();
Root root = serializer.Deserialize<Root>(json);
using (WebClient webClient = new WebClient())
{
    byte[] bytes = webClient.DownloadData(root.data);
    Response.Clear();
    Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(root.data));
    Response.BinaryWrite(bytes);
    Response.Flush();
    Response.End();
}

 


Answers (7)