David Smith wrote: > The server may be temporarily down. If DNS info comes back, that's a better > sign that the URL is valid.
I think an HTTP request for the resource coming back with a reply of "200 OK" is a better sign that the URL is valid. DNS information will simply indicate that the domain name exists, but that doesn't warrant a conclusion that all addresses at that domain refer to valid resources. > Therefore a ping or maybe tracert would be best with a timeout limit imposed. If the server is temporarily down, then a ping won't come back, either. Like I said, if Get or Head fail, you'll get an exception telling you why. Maybe it's an EIdConnectTimeout, or EIdResolveError, or EIdHTTPProtocolException. The latter will also include an HTTP response code. An HTTP request will include a DNS lookup anyway to resolve the host name in the URL. The key is that the code to initiate the command can be just one line. Everything else is error checking, which is the primary task of Jamie's code. -- Rob

