pub fn parse_request_body(&mut self, body: Map<String, Value>) -> Map<String, Value> {
        fn parse_body(this: &mut Interpreter, body: Map<String, Value>) -> Map<String, Value> {
            let mut map: Map<String, Value> = Map::new();
            for (k, v) in body {
                let new_val = match v {
                    Value::Object(obj) => Value::Object(parse_body(this, obj)),
                    Value::Array(arr) => Value::Array(
                        arr.iter()
                            .map(|val| from_str(&this.request_value(val)).unwrap())
                            .collect::<Vec<_>>(),
                    ),
                    _ => {
                        let value = this.request_value(&v);
                        from_str(&value).unwrap()
                    }
                };

                map.insert(k, new_val);
            }

            map
        }

        parse_body(self, body)
    }
/// Parsing the request body and get the formated body
Parsing the request body and get the formated body
Parsing the request body and get the formated body
pub fn parse_request_body(&mut self, body: Map<String, Value>) -> Map<String, Value> {
        fn parse_body(this: &mut Interpreter, body: Map<String, Value>) -> Map<String, Value> {
            let mut map: Map<String, Value> = Map::new();
            for (k, v) in body {
                let new_val = match v {
                    Value::Object(obj) => Value::Object(parse_body(this, obj)),
                    Value::Array(arr) => Value::Array(
                        arr.iter()
                            .map(|val| from_str(&this.request_value(val)).unwrap())
                            .collect::<Vec<_>>(),
                    ),
                    _ => {
                        let value = this.request_value(&v);
                        from_str(&value).unwrap()
                    }
                };
                map.insert(k, new_val);
            }
            map
        }
        parse_body(self, body)
    }
pub fn parse_request_body ( & mut self , body : Map < String , Value > ) -> Map < String , Value > { fn parse_body ( this : & mut Interpreter , body : Map < String , Value > ) -> Map < String , Value > { let mut map : Map < String , Value > = Map :: new ( ) ; for ( k , v ) in body { let new_val = match v { Value :: Object ( obj ) => Value :: Object ( parse_body ( this , obj ) ) , Value :: Array ( arr ) => Value :: Array ( arr . iter ( ) . map ( | val | from_str ( & this . request_value ( val ) ) . unwrap ( ) ) . collect :: < Vec < _ > > ( ) , ) , _ => { let value = this . request_value ( & v ) ; from_str ( & value ) . unwrap ( ) } } ; map . insert ( k , new_val ) ; } map } parse_body ( self , body ) }
Parsing the request body and get the formated body
Parsing the request body and get the formated body
&mut self
body
Map<String, Value>