pub async fn body_json<T: DeserializeOwned>(&mut self) -> Result<T> {
        let reader = self.reader().await?;
        serde_json::from_reader(reader).map_err(|err| {
            let msg = format!("error parsing request body as json: {}", err);
            error!("{}", msg);
            Error::http((StatusCode::BAD_REQUEST, msg))
        })
    }
/// Get the request body as JSON and deserialize into `T`.
///
/// If deserialization fails, log an error and return `400 Bad Request`.
/// (If this logic is not appropriate, consider using `reader` and using `serde_json` directly)
Get the request body as JSON and deserialize into `T`.
If deserialization fails, log an error and return `400 Bad Request`.
(If this logic is not appropriate, consider using `reader` and using `serde_json` directly)
Get the request body as JSON and deserialize into ` T ` . If deserialization fails log an error and return ` 400 Bad Request ` . ( If this logic is not appropriate consider using ` reader ` and using ` serde_json ` directly )
pub async fn body_json<T: DeserializeOwned>(&mut self) -> Result<T> {
        let reader = self.reader().await?;
        serde_json::from_reader(reader).map_err(|err| {
            let msg = format!("error parsing request body as json: {}", err);
            error!("{}", msg);
            Error::http((StatusCode::BAD_REQUEST, msg))
        })
    }
pub async fn body_json < T : DeserializeOwned > ( & mut self ) -> Result < T > { let reader = self . reader ( ) . await ? ; serde_json :: from_reader ( reader ) . map_err ( | err | { let msg = format ! ( " " err ) ; error ! ( " " msg ) ; Error :: http ( ( StatusCode :: BAD_REQUEST , msg ) ) } ) }
Get the request body as JSON and deserialize into `T`.
Get the request body as JSON and deserialize into ` T ` .
&mut self