extern crate iron; extern crate iron_params as params; use iron::prelude::*; use params::*; // To run, $ cargo run --example simple // to use, $ curl -d "ids=1,2,3&channel=1" "http://localhost:3000/?ids=4,5,6," fn main() { let mut chain = Chain::new(handler); chain.link_before(params::Params {}); Iron::new(chain).http("localhost:3000").unwrap(); } fn handler(req: &mut Request) -> IronResult { let mut content = String::new(); let ids = req.params("ids"); content.push_str(&format!("ids:{:?}\n", ids)); let channel = req.param::("channel"); content.push_str(&format!("channel:{:?}\n", channel)); let channel = req.param::("channel"); content.push_str(&format!("channel:{:?}\n", channel)); let channel = req.param::("channel"); content.push_str(&format!("channel:{:?}\n", channel)); let body=req.body(); content.push_str(&format!("body:{:?}\n", body)); Ok(Response::with((iron::status::Ok, content))) }