Example #1
0
        public TitlingResult WebInfo(string uriString)
        {
            if (uriString == null)
            {
                throw new ArgumentNullException(nameof(uriString));
            }

            Uri uri;

            try
            {
                uri = new Uri(uriString);
            }
            catch (UriFormatException ex)
            {
                return(TitlingResult.Failure(uriString, ex));
            }
            return(WebInfo(uri));
        }
Example #2
0
        public TitlingResult WebInfo(Uri uri)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }
            if (!uri.IsAbsoluteUri)
            {
                throw new ArgumentException("Uri must be absolute: " + uri, nameof(uri));
            }

            if (TitlingRequest.IsSchemeSupported(uri))
            {
                return(WebInfo(new TitlingRequest(uri)));
            }
            else
            {
                var ex = new NotSupportedException("Unsupported scheme: " + uri.Scheme);
                return(TitlingResult.Failure(uri.OriginalString, ex));
            }
        }