The only way is to send a HEAD request to the website and check the Content-Type header.
↧
Answer by bohdan_trotsenko for How do I know content type in C#.NET for an URL?
↧
The only way is to send a HEAD request to the website and check the Content-Type header.