iron-params [](https://travis-ci.org/hikelee/iron-params)
====
> Request parameters extension for the [Iron](https://github.com/iron/iron) web framework.
iron-params is a fast, convenient, and flexible extension for Iron Request. It
allows retriving query/form params from iron request and convert into the type you want.
## Example
```rust
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<Response> {
let mut content = String::new();
let ids = req.params("ids");
content.push_str(&format!("ids:{:?}\n", ids));
let channel = req.param::<i32>("channel");
content.push_str(&format!("channel:{:?}\n", channel));
let channel = req.param::<String>("channel");
content.push_str(&format!("channel:{:?}\n", channel));
let channel = req.param::<f32>("channel");
content.push_str(&format!("channel:{:?}\n", channel));
Ok(Response::with((iron::status::Ok, content)))
}
```
## Installation
If you're using cargo, just add iron-params to your `Cargo.toml`.
```toml
[dependencies]
iron-params = "*"
```
Otherwise, `cargo build`, and the rlib will be in your `target` directory.
## [Examples](/examples)