I'm using the getAsync(URL).Result function inside an SSIS C# task. In the debug window I can see the Result="{Not yet computed}".
The code is working very well for the last 1 year, although stops working after a new release of the API came up. It seems it's not waiting for the response. MY CODE:
public void Main()
{
GetRequest(Dts.Variables["User::URL"].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
}
private static void GetRequest(string url)
{
try
{
HttpClient client = new HttpClient();
HttpResponseMessage response = client.GetAsync(url).Result;
response.EnsureSuccessStatusCode();
}
catch (Exception e)
{
System.Console.WriteLine("Caught Exception: " + e.Message);
}
}
Can someone give me some insights?
Thank you