I'm trying to download an attachment but as soon as the SendAsync(request) is made i get a hard crash of visual studio
thanks
Marc
public static async Task<bool> DownloadTaskAttachmentAsync(string attachmentId, string localDirectory)
{
try
{
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://nikolamotor.atlassian.net/rest/api/3/attachment/content/177400");
request.Headers.Add("Authorization", "Basic BLAHBlahBLAHBlahBLAHBlahBLAHBlah");
request.Headers.Add("Cookie", "atlassian.xsrf.token=addBLAHBlahBLAHBlah_lin");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
return true;
}
catch(Exception ex)
{
Console.Write(ex.Message);
return false;
}
}