private void Configure(HttpSettings settings) { this.SetCacheHeaders(settings.AllowCache ? null : "no-cache"); }
/// <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; }