-
Hey, I have been going through the axum docs, and they suggest to use pub async fn handler(
State(db_pool): State<AppState>,
body: Request<Body>,
) -> Result<impl IntoResponse, ApiError> {
println!("{:?}", body);
let my_body_string = <Body as Into<String>>::into(*body.body());
Ok(())
} How can I make it usable? I don't find enough information about the type |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
You need to use the methods from the But from your code it seems like you just want a pub async fn handler(
State(db_pool): State<AppState>,
body: String,
) -> Result<impl IntoResponse, ApiError> {
println!("{:?}", body);
Ok(())
} |
Beta Was this translation helpful? Give feedback.
This is what I wanted... Yes I know that I can use String as an extractor, but I don't know how that magic happens, thus I wanted to implement it myself.