pub fn json(mut self, val: &impl Serialize) -> Self {
        let vec = serde_json::to_vec(val).expect("json() must serialize to JSON");
        *self.req.body_mut() = vec.into();
        self
    }
/// Set the bytes of this request body by serializing a value into JSON.
///
/// # Example
///
/// ```
/// let req = warp::test::request()
///     .json(&true);
/// ```
Set the bytes of this request body by serializing a value into JSON.
Set the bytes of this request body by serializing a value into JSON .
pub fn json(mut self, val: &impl Serialize) -> Self {
        let vec = serde_json::to_vec(val).expect("json() must serialize to JSON");
        *self.req.body_mut() = vec.into();
        self
    }
pub fn json ( mut self , val : & impl Serialize ) -> Self { let vec = serde_json :: to_vec ( val ) . expect ( " " ) ; * self . req . body_mut ( ) = vec . into ( ) ; self }
Set the bytes of this request body by serializing a value into JSON.
Set the bytes of this request body by serializing a value into JSON .
mut self
val
&impl Serialize
example
None