-
HttpServer::new(|| {
App::new() ‣App<AppEntry, Body>
.service(web::resource("/path").route(web::post().to(x)))
})
.bind(... To get headers, actix requires input type as async fn x(req: HttpRequest) -> impl Responder {
let y= req.headers();
...
} To parse json-style struct, actix requires input type as async fn x(req: web::Json<..>) -> Result<HttpResponse> {
let z = req...;
... What if I want both data ( |
Beta Was this translation helpful? Give feedback.
Answered by
ghost
Jul 18, 2021
Replies: 1 comment
-
found it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found it.
just let
async fn x(data: web::Json<..>, req: HttpRequest)...
ref