The code below works great in a console application.
When it runs on IIS in a web application it times out on the client.GetAync(URL) line.
Any ideas?
static async Task<byte[]> GetLogo(string URL, string AccessToken)
{
byte[] imageData = null;
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Authorization", "Bearer " + AccessToken);
HttpResponseMessage response = await client.GetAsync(URL);
if (response.IsSuccessStatusCode)
{
imageData = await response.Content.ReadAsByteArrayAsync();
}
}
return imageData;
}
Thanks,