コード例 #1
0
ファイル: Requester.cs プロジェクト: jefersonsv/HttpRequester
        public Requestera(EnumHttpProvider httpProvider)
        {
            this.HttpProvider = httpProvider;

            if (httpProvider == EnumHttpProvider.AngleSharp)
            {
                this.angleSharpClient = AngleSharp.BrowsingContext.New();
            }
            else if (httpProvider == EnumHttpProvider.BetterWebClient)
            {
                this.betterWebClient = new BetterWebClient();
            }
            else if (httpProvider == EnumHttpProvider.ChromeHeadless)
            {
                this.chromeHeadlessClient = new ChromeClient(true);
            }
            else if (httpProvider == EnumHttpProvider.ChromeHeadlessPersistent)
            {
                this.chromeHeadlessPersistentClient = new ChromePersistentClient(true);
            }
            else if (httpProvider == EnumHttpProvider.HttpClient)
            {
                this.httpClient = new System.Net.Http.HttpClient();
            }
            else if (httpProvider == EnumHttpProvider.WebClient)
            {
                this.webClient = new WebClient();
            }
            else
            {
                throw new ArgumentNullException("httpProvider");
            }
        }
コード例 #2
0
 public ChromePersistentDriverRequester()
 {
     this.client = new ChromePersistentClient(true);
 }