예제 #1
0
 private void Configure(HttpSettings settings)
 {
     this.SetCacheHeaders(settings.AllowCache ? null : "no-cache");
 }
예제 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public HttpService(IJsonService jsonService, ILoggingService loggingService, IHttpInterceptor httpInterceptor, HttpSettings httpSettings)
        {
            this.client = new HttpClient();
            this.Configure(httpSettings);

            // Timeout can be configured only once during the lifetime
            this.client.Timeout = TimeSpan.FromMilliseconds(httpSettings.Timeout);

            this.jsonService     = jsonService;
            this.loggingService  = loggingService;
            this.httpInterceptor = httpInterceptor;
            this.httpSettings    = httpSettings;
        }