I would like to use C# to check if a file exists at a specified url without triggering and catching a 404 error as in the code below.
bool urlExists = true;
try {
using (var webClient = new WebClient()) {
byte[] data = webClient.DownloadData(myUrl);
}
}
catch (WebException) {
urlExists = false;
}