/// Make an http request and collect the response body into a Vec of bytes.
///
/// Specifically, this takes the body of the response and concatenates it into a single Vec of
/// bytes so that any errors in receiving it can be captured immediately, instead of needing to
/// handle them as part of parsing the response body.
Make an http request and collect the response body into a Vec of bytes.
Specifically, this takes the body of the response and concatenates it into a single Vec of
bytes so that any errors in receiving it can be captured immediately, instead of needing to
handle them as part of parsing the response body.
Make an http request and collect the response body into a Vec of bytes . Specifically this takes the body of the response and concatenates it into a single Vec of bytes so that any errors in receiving it can be captured immediately instead of needing to handle them as part of parsing the response body .
async fn make_request(
        http_client: &mut HR,
        request: http::Request<hyper::Body>,
    ) -> Result<(Parts, Vec<u8>), hyper::Error> {
        info!("Making http request to: {}", request.uri());
        let res = await!(http_client.request(request)).map_err(|err| {
            warn!("Unable to perform request: {}", err);
            err
        })?;
        let (parts, body) = res.into_parts();
        let data = await!(body.compat().try_concat())?;
        Ok((parts, data.to_vec()))
    }
async fn make_request ( http_client : & mut HR , request : http :: Request < hyper :: Body > , ) -> Result < ( Parts , Vec < u8 > ) , hyper :: Error > { info ! ( " " request uri ( ) ) ; let res = await ! ( http_client request ( request ) ) . map_err ( | err | { warn ! ( " " err ) ; err } ) ? ; let ( parts , body ) = res . into_parts ( ) ; let data = await ! ( body compat ( ) try_concat ( ) ) ? ; Ok ( ( parts , data . to_vec ( ) ) ) }
Make an http request and collect the response body into a Vec of bytes.
Make an http request and collect the response body into a Vec of bytes .
http_client
&mut HR
request
http::Request<hyper::Body>