Esempio n. 1
0
 protected virtual HttpClientWebReader CreateHttpClientWebReader(Uri url, ContentKind contentKind, IWebReader parent = null, ContentType contentType = null)
 {
     url = HttpClientWebReaderManager.GetUrl(url, parent);
     if ((ContentType)null == contentType && (Uri)null != url)
     {
         contentType = EnumerableExtensions.SingleOrDefaultSafe <ContentType>((IEnumerable <ContentType>) this._contentTypeDetector.GetContentType(url, (string)null, (string)null));
     }
     return(new HttpClientWebReader((IWebReaderManager)this, this.CreateHttpClient(url, parent, contentKind, contentType), contentType, this._contentTypeDetector));
 }
Esempio n. 2
0
        protected virtual HttpClient CreateHttpClient(Uri url, IWebReader parent, ContentKind contentKind, ContentType contentType)
        {
            url = HttpClientWebReaderManager.GetUrl(url, parent);
            Uri referrer = HttpClientWebReaderManager.GetReferrer(parent);

            if ((Uri)null != referrer)
            {
                url = new Uri(referrer, url);
            }
            return(this._httpClientFactory.CreateClient(url, referrer, contentKind, contentType));
        }