public static async Task <HttpServiceResponse> ExecuteAndReadAsync( this IHttpClientService client, HttpClientServiceRequest request ) { var responseMessage = await client.ExecuteAsync(request); var serviceResponse = await ReadAsync( HttpServiceResponse.Empty, responseMessage); return(serviceResponse); }
public static async Task <HttpServiceResponse <T> > ExecuteAndReadAsync <T>( this IHttpClientService client, HttpClientServiceRequest request ) { var responseMessage = await client.ExecuteAsync(request); var serviceResponse = await ReadAsync( HttpServiceResponse <T> .Empty, responseMessage); serviceResponse = serviceResponse .WithData( await responseMessage.Content.ReadAsAsync <T>() ); return(serviceResponse ); }