public HoneyCombHttpClient(HttpClient httpClient, HttpClientOptions options,
                                   IEnumerable <JsonConverter> jsonConverters, AppSettings appSettings)
        {
            _httpClient             = httpClient;
            _options                = options;
            _jsonConverters         = jsonConverters;
            _jsonSerializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                Converters       = jsonConverters?.ToList()
            };
            _appSettings = appSettings;

            var appContext = $"{_appSettings.Name} {_appSettings.Version} ({_appSettings.VersionNumber})";

            _httpClient.DefaultRequestHeaders.Add("AppContext", appContext);
        }
示例#2
0
 public HoneyCombHttpClient(HttpClient httpClient, HttpClientOptions options)
 {
     _httpClient = httpClient;
     _options    = options;
 }