Trait nickel::FormBody [] [src]

pub trait FormBody {
    fn form_body(&mut self) -> Result<&Params(StatusCode, BodyError)>;
}

Required Methods

fn form_body(&mut self) -> Result<&Params(StatusCode, BodyError)>

Extracts URL encoded data from the request body.

Examples

#[macro_use] extern crate nickel;
use nickel::{Nickel, HttpRouter, FormBody};

fn main() {
    let mut server = Nickel::new();
    server.post("/a", middleware! { |req, res|
        let form_body = try_with!(res, req.form_body());
        return res.send(format!("Post: {:?}", form_body))
    });
}

Implementors