Пример #1
0
        /// <summary>
        /// default ctor
        /// </summary>
        /// <param name="maxNumberOfCachedRequests"></param>
        public HttpJsonRequestFactory(int maxNumberOfCachedRequests, Func<HttpMessageHandler> httpMessageHandler = null, bool acceptGzipContent = true, string authenticationScheme = null)
        {
            this.maxNumberOfCachedRequests = maxNumberOfCachedRequests;
            this.httpMessageHandler = httpMessageHandler;
            this.acceptGzipContent = acceptGzipContent;
            this.authenticationScheme = authenticationScheme;

#if !DNXCORE50
            var maxIdleTime = ServicePointManager.MaxServicePointIdleTime;
#else
            // TODO [ppekrol] this matches ServicePointManager.MaxServicePointIdleTime
            var maxIdleTime = 100 * 1000;
#endif

            httpClientCache = new HttpClientCache(maxIdleTime);

            ResetCache();
        }
Пример #2
0
        /// <summary>
        /// default ctor
        /// </summary>
        /// <param name="maxNumberOfCachedRequests"></param>
        public HttpJsonRequestFactory(int maxNumberOfCachedRequests, Func<HttpMessageHandler> httpMessageHandler = null, bool acceptGzipContent = true)
        {
            this.maxNumberOfCachedRequests = maxNumberOfCachedRequests;
            this.httpMessageHandler = httpMessageHandler;
            this.acceptGzipContent = acceptGzipContent;
            httpClientCache = new HttpClientCache(ServicePointManager.MaxServicePointIdleTime);

            ResetCache();
        }
		/// <summary>
		/// default ctor
		/// </summary>
		/// <param name="maxNumberOfCachedRequests"></param>
		public HttpJsonRequestFactory(int maxNumberOfCachedRequests, HttpMessageHandler httpMessageHandler = null)
		{
			this.maxNumberOfCachedRequests = maxNumberOfCachedRequests;
			this.httpMessageHandler = httpMessageHandler;
			httpClientCache = new HttpClientCache();

		    ResetCache();
		}
		/// <summary>
		/// default ctor
		/// </summary>
		/// <param name="maxNumberOfCachedRequests"></param>
		public HttpJsonRequestFactory(int maxNumberOfCachedRequests, HttpMessageHandler httpMessageHandler = null, bool acceptGzipContent = true)
		{
			this.maxNumberOfCachedRequests = maxNumberOfCachedRequests;
			this.httpMessageHandler = httpMessageHandler;
			this.acceptGzipContent = acceptGzipContent;
			httpClientCache = new HttpClientCache();

		    ResetCache();
		}
Пример #5
0
        /// <summary>
        /// default ctor
        /// </summary>
        /// <param name="maxNumberOfCachedRequests"></param>
        public HttpJsonRequestFactory(int maxNumberOfCachedRequests, Func<HttpMessageHandler> httpMessageHandler = null, bool acceptGzipContent = true, string authenticationScheme = null)
        {
            this.maxNumberOfCachedRequests = maxNumberOfCachedRequests;
            this.httpMessageHandler = httpMessageHandler;
            this.acceptGzipContent = acceptGzipContent;
            this.authenticationScheme = authenticationScheme;

            var maxIdleTime = ServicePointManager.MaxServicePointIdleTime;

            httpClientCache = new HttpClientCache(maxIdleTime);

            ResetCache();
        }