Ejemplo n.º 1
0
        public async Task<WebApiCallReport> GetAsync(HttpRequestMessage httpRequest)
        {            
            var responseMessage = await _httpClient.SendAsync(httpRequest);
            var webApiCallReport = new WebApiCallReport
            {
                HttpCode = responseMessage.StatusCode,
                StringResponse = await responseMessage.Content.ReadAsStringAsync(),
                ErrorMessage = string.Empty,
                Successful = responseMessage.IsSuccessStatusCode
            };
            if ( responseMessage.IsSuccessStatusCode == false )
                throw new WebApiException(webApiCallReport);

            return webApiCallReport;
        }
 public WebApiException(WebApiCallReport webApiCallReport)
 {
     WebApiCallReport = webApiCallReport;
 }