mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
migrate websocket-chat example
This commit is contained in:
@ -60,7 +60,10 @@ async fn add(
|
||||
|
||||
/// This handler manually parse json object. Bytes object supports FromRequest trait (extractor)
|
||||
/// and could be loaded from request payload automatically
|
||||
async fn index_add(body: web::Bytes, pool: web::Data<Pool>) -> Result<HttpResponse, Error> {
|
||||
async fn index_add(
|
||||
body: web::Bytes,
|
||||
pool: web::Data<Pool>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
// body is loaded, now we can deserialize id with serde-json
|
||||
let r_obj = serde_json::from_slice::<MyUser>(&body);
|
||||
|
||||
|
Reference in New Issue
Block a user