Validate the URL before making a request