pub fn json(mut self, body: impl Serialize) -> Result<Self> {
        let data = serde_json::to_vec(&body)?;
        self.set_header(headers::ContentType::json());
        *self.inner.body_mut() = Body::from(data);
        Ok(self)
    }
/// Set the body of the response to a JSON payload
Set the body of the response to a JSON payload
Set the body of the response to a JSON payload
pub fn json(mut self, body: impl Serialize) -> Result<Self> {
        let data = serde_json::to_vec(&body)?;
        self.set_header(headers::ContentType::json());
        *self.inner.body_mut() = Body::from(data);
        Ok(self)
    }
pub fn json ( mut self , body : impl Serialize ) -> Result < Self > { let data = serde_json :: to_vec ( & body ) ? ; self . set_header ( headers :: ContentType :: json ( ) ) ; * self . inner . body_mut ( ) = Body :: from ( data ) ; Ok ( self ) }
Set the body of the response to a JSON payload
Set the body of the response to a JSON payload
mut self
body
impl Serialize