2019-06-17 20:34:23 +02:00
|
|
|
// <urlencoded>
|
|
|
|
// use actix_web::{Error, HttpRequest, HttpResponse};
|
|
|
|
// use futures::future::{ok, Future};
|
|
|
|
// use serde::Deserialize;
|
|
|
|
|
|
|
|
// #[derive(Deserialize)]
|
|
|
|
// struct FormData {
|
|
|
|
// username: String,
|
|
|
|
// }
|
|
|
|
|
|
|
|
// fn index(req: &HttpRequest) -> Box<Future<Item = HttpResponse, Error = Error>> {
|
|
|
|
// req.urlencoded::<FormData>() // <- get UrlEncoded future
|
|
|
|
// .from_err()
|
|
|
|
// .and_then(|data| {
|
|
|
|
// // <- deserialized instance
|
|
|
|
// println!("USERNAME: {:?}", data.username);
|
|
|
|
// ok(HttpResponse::Ok().into())
|
|
|
|
// })
|
|
|
|
// .responder()
|
|
|
|
// }
|
|
|
|
// </urlencoded>
|
2019-06-19 06:20:50 +02:00
|
|
|
pub fn main() {}
|