1 2 3 4 5 6 7 8 9 10 11 12 13
extern crate iron; use iron::prelude::{ Request }; extern crate json; extern crate bodyparser; pub use iron::Plugin; pub fn parse(req: &mut Request) -> json::JsonValue { let unwrapped = req.get::<bodyparser::Raw>().unwrap().unwrap(); let parsed = json::parse(&unwrapped).unwrap(); return parsed; }