public IActionResult GetTasksFromIBM([FromBody] IbmUrlModel model) { string xml; List <TaskModel> nodesInXml = null; using (WebClient client = new WebClient()) { ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; String username = model.Name; String password = model.Password; String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password)); client.Headers.Add("Authorization", "Basic " + encoded); xml = client.DownloadString(model.Url); nodesInXml = XmlParser.CreateTaskObjects(xml); SaveToDatabase(nodesInXml, model.ProjectId); return(Ok()); } }