public HttpConnectResponse(HttpConnectResponse response) { StatusCode = response.StatusCode; Headers = response.Headers; Request = response.Request; Content = response.Content; Status = response.Status; Exception = response.Exception; }
public async Task <HttpConnectResponse <T> > SendAsync <T>(HttpConnectRequest request, CancellationToken cancellationToken) { HttpConnectResponse response = await SendAsync(request, cancellationToken); try { if (response.IsSuccess) { var deserializedResponse = new HttpConnectResponse <T>(response); deserializedResponse.Data = deserializedResponse.Content.Deserialize <T>(); return(deserializedResponse); } return(new HttpConnectResponse <T>(response)); } catch (Exception exception) { HttpConnectResponse <T> errorResponse = new HttpConnectResponse <T>(response); errorResponse.SetError(exception); return(errorResponse); } }