diff --git a/kube-client/src/client/body.rs b/kube-client/src/client/body.rs index 1a0475f33..981d685db 100644 --- a/kube-client/src/client/body.rs +++ b/kube-client/src/client/body.rs @@ -44,6 +44,11 @@ impl Body { Body::new(Kind::Wrap(body.map_err(Into::into).boxed_unsync())) } + /// Collect all the data frames and trailers of the request body + pub async fn collect_bytes(self) -> Result { + Ok(self.collect().await?.to_bytes()) + } + pub(crate) fn into_data_stream( self, ) -> impl Stream::Data, ::Error>> {