Before downloading a file from a link, I need to get some of its data (name, size, Content-type etc.)
WebResponse response = null;
using (token.Token.Register(() => client.Abort(), useSynchronizationContext: false))
{
response = await Task.Run(() => client.GetResponseAsync()).ConfigureAwait(true);
token.Token.ThrowIfCancellationRequested();
}
after I check the client type and get the necessary information. But there is a type of links for which I can’t get the data. When calling
response = await Task.Run (() => client.GetResponseAsync ())
error 404 is returned. What to do? I take an example of links with https://www.mp3juices.cc/