gotham-serde-json-body-parser

JSON body parser for the Gotham web framework.

This is a simple integration of serde_json crate to eliminate the boilerplate code of parsing a request body. If parsing fails, a HTTP 422 (Unprocessable entity) is returned.

```rust use gothamserdejsonbodyparser::JSONBody;

[derive(Debug, Deserialize)]

struct Person { name: String, }

pub fn sayhello(state: State) -> Box { Box::new(state.json::().andthen(|(state, person)| { let res = createresponse( &state, StatusCode::Ok, Some(( format!("Hello, {}!", person.name).intobytes(), mime::TEXT_PLAIN, )), );

    Ok((state, res))
}))

} ```