RestOperation.fromHttpOperation constructor
RestOperation.fromHttpOperation(
- AWSHttpOperation<
AWSBaseHttpResponse> httpOperation
Takes AWSHttpOperation and ensures response not streamed.
Implementation
factory RestOperation.fromHttpOperation(AWSHttpOperation httpOperation) {
final cancelOp = httpOperation.operation.then<AWSHttpResponse>((
response,
) async {
return switch (response) {
AWSStreamedHttpResponse _ => await response.read(),
AWSHttpResponse _ => response,
};
});
return RestOperation._(
cancelOp,
requestProgress: httpOperation.requestProgress,
responseProgress: httpOperation.responseProgress,
);
}