pub async fn request<T: DeserializeOwned>(&self, request: Request) -> Result<T> {
        let resp = self.make_request(request).await?;

        let mut buf = body::aggregate(resp.into_body())
            .await
            .map_err(|source| Error::ChunkingResponse { source })?;

        let mut bytes = vec![0; buf.remaining()];
        buf.copy_to_slice(&mut bytes);

        let result = crate::json_from_slice(&mut bytes);

        result.map_err(|source| Error::Parsing {
            body: bytes,
            source,
        })
    }
/// Execute a request, chunking and deserializing the response.
///
/// # Errors
///
/// Returns [`Error::Unauthorized`] if the configured token has become
/// invalid due to expiration, revokation, etc.
Execute a request, chunking and deserializing the response.
Execute a request chunking and deserializing the response .
pub async fn request<T: DeserializeOwned>(&self, request: Request) -> Result<T> {
        let resp = self.make_request(request).await?;
        let mut buf = body::aggregate(resp.into_body())
            .await
            .map_err(|source| Error::ChunkingResponse { source })?;
        let mut bytes = vec![0; buf.remaining()];
        buf.copy_to_slice(&mut bytes);
        let result = crate::json_from_slice(&mut bytes);
        result.map_err(|source| Error::Parsing {
            body: bytes,
            source,
        })
    }
pub async fn request < T : DeserializeOwned > ( & self , request : Request ) -> Result < T > { let resp = self . make_request ( request ) . await ? ; let mut buf = body :: aggregate ( resp . into_body ( ) ) . await . map_err ( | source | Error :: ChunkingResponse { source } ) ? ; let mut bytes = vec ! [ 0 buf remaining ( ) ] ; buf . copy_to_slice ( & mut bytes ) ; let result = crate :: json_from_slice ( & mut bytes ) ; result . map_err ( | source | Error :: Parsing { body : bytes , source , } ) }
Execute a request, chunking and deserializing the response.
Execute a request chunking and deserializing the response .
&self
request
Request
&self
request
Request
errors
Returns [`Error::Unauthorized`] if the configured token has become
invalid due to expiration, revokation, etc.
Returns [ ` Error :: Unauthorized ` ] if the configured token has become invalid due to expiration revokation etc .