示例#1
0
        public HttpNavigator(HttpNavigatorBuilder HttpNavigatorBuilder)
        {
            var httpHandler = HttpNavigatorBuilder.GetHttpHandler();

            httpHandler.CookieContainer = Cookies;

            HttpClient = new HttpClient(httpHandler);
            HttpClient.DefaultRequestHeaders.Add("User-Agent", UserAgents[new Random().Next(0, UserAgents.Count - 1)]);
        }
示例#2
0
        public HttpNavigator()
        {
            var builder = new HttpNavigatorBuilder();
            var handler = builder.GetHttpHandler();

            handler.CookieContainer = Cookies;

            HttpClient = HttpClientFactory.Create(handler);
            HttpClient.DefaultRequestHeaders.Add("User-Agent", UserAgents[new Random().Next(0, UserAgents.Count - 1)]);
        }