Handler not implemented for axum_extra::handler::Or #2580
-
Bug ReportVersion
Platform
DescriptionI have two functions with signatures: pub(crate) async fn query_post_handler(
state: State<AppState>,
headers: HeaderMap,
DirectOrForm(params): DirectOrForm<QueryParams>,
) -> axum::Result<Response<String>> I am trying to use them in my router as: .route(
"/",
post(query::query_post_handler.or(update::update_post_handler)),
) However, this does not work as expected, with:
|
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Feb 8, 2024
Replies: 1 comment 2 replies
-
Only the last handler in a chain of |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Natureshadow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only the last handler in a chain of
or
s can consume the request body. Seems likequery_post_handler
consumes the request inDirectOrForm<QueryParams>
. It can't do that to be used withor
. axum only allows consuming the body once.