mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
simplify payload api; add missing http error helper functions
This commit is contained in:
@ -18,8 +18,8 @@ fn main() {
|
||||
.client_timeout(1000)
|
||||
.client_disconnect(1000)
|
||||
.server_hostname("localhost")
|
||||
.finish(|_req: Request| {
|
||||
_req.body().limit(512).and_then(|bytes: Bytes| {
|
||||
.finish(|mut req: Request| {
|
||||
req.body().limit(512).and_then(|bytes: Bytes| {
|
||||
info!("request body: {:?}", bytes);
|
||||
let mut res = Response::Ok();
|
||||
res.header("x-head", HeaderValue::from_static("dummy value!"));
|
||||
|
@ -8,8 +8,8 @@ use futures::Future;
|
||||
use log::info;
|
||||
use std::env;
|
||||
|
||||
fn handle_request(_req: Request) -> impl Future<Item = Response, Error = Error> {
|
||||
_req.body().limit(512).from_err().and_then(|bytes: Bytes| {
|
||||
fn handle_request(mut req: Request) -> impl Future<Item = Response, Error = Error> {
|
||||
req.body().limit(512).from_err().and_then(|bytes: Bytes| {
|
||||
info!("request body: {:?}", bytes);
|
||||
let mut res = Response::Ok();
|
||||
res.header("x-head", HeaderValue::from_static("dummy value!"));
|
||||
|
Reference in New Issue
Block a user