コード例 #1
0
        public static T ReadAs <T>(this WebCache webCache, string url, string postData = null, CookieContainer cookies = null, string referer = null, IWebProxy proxy = null, bool forceUTF8 = false, bool allowUnsafeHeader = false, string userAgent = null, Encoding encoding = null, NameValueCollection headers = null, bool cache = true)
        {
            var responseString = webCache.ReadAsString(url, postData, cookies, referer, proxy, forceUTF8, allowUnsafeHeader, userAgent, encoding, headers, cache);
            var obj            = JsonConvert.DeserializeObject <T>(responseString);

            return(obj);
        }
コード例 #2
0
        public static HtmlAgilityPack.HtmlDocument ReadAsHtmlDocument(this WebCache webCache, string url, string postData = null, CookieContainer cookies = null, string referer = null, IWebProxy proxy = null, bool forceUTF8 = false, bool allowUnsafeHeader = false, string userAgent = null, Encoding encoding = null, NameValueCollection headers = null, bool cache = true)
        {
            var          responseString = webCache.ReadAsString(url, postData, cookies, referer, proxy, forceUTF8, allowUnsafeHeader, userAgent, encoding, headers, cache);
            HtmlDocument htmlDoc        = new HtmlDocument();

            htmlDoc.LoadHtml(responseString);
            return(htmlDoc);
        }
コード例 #3
0
        public static RssToolkit.Rss.RssDocument ReadAsRssDocument(this WebCache webCache, string url, string postData = null, CookieContainer cookies = null, string referer = null, IWebProxy proxy = null, bool forceUTF8 = false, bool allowUnsafeHeader = false, string userAgent = null, Encoding encoding = null, NameValueCollection headers = null, bool cache = true)
        {
            var responseString = webCache.ReadAsString(url, postData, cookies, referer, proxy, forceUTF8, allowUnsafeHeader, userAgent, encoding, headers, cache);

            return(RssToolkit.Rss.RssDocument.Load(responseString));
        }