public async Task <ApiResponse <LogStorageSas> > GetLogStorageSas() { loggerService.StartMethod(); int statusCode; LogStorageSas logStorageSas = default; try { await serverConfigurationRepository.LoadAsync(); var url = serverConfigurationRepository.InquiryLogApiUrl; var response = await apiClient.GetAsync(url); statusCode = (int)response.StatusCode; loggerService.Info($"Response status: {statusCode}"); if (statusCode == (int)HttpStatusCode.OK) { var content = await response.Content.ReadAsStringAsync(); logStorageSas = JsonConvert.DeserializeObject <LogStorageSas>(content); } } catch (Exception ex) { loggerService.Exception("Failed get log storage SAS.", ex); statusCode = 0; logStorageSas = default; } loggerService.EndMethod(); return(new ApiResponse <LogStorageSas>(statusCode, logStorageSas)); }
public async Task <ApiResponse <LogStorageSas> > GetLogStorageSas() { loggerService.StartMethod(); int statusCode; LogStorageSas logStorageSas = default; try { var requestUrl = $"{AppSettings.Instance.ApiUrlBase.TrimEnd('/')}/inquirylog"; var response = await apiClient.GetAsync(requestUrl); statusCode = (int)response.StatusCode; loggerService.Info($"Response status: {statusCode}"); if (statusCode == (int)HttpStatusCode.OK) { var content = await response.Content.ReadAsStringAsync(); logStorageSas = JsonConvert.DeserializeObject <LogStorageSas>(content); } } catch (Exception ex) { loggerService.Exception("Failed get log storage SAS.", ex); statusCode = 0; logStorageSas = default; } loggerService.EndMethod(); return(new ApiResponse <LogStorageSas>(statusCode, logStorageSas)); }