Skip to content

Different Form extractors; same route #1800

Answered by robjtede
dastardlychimp asked this question in Q&A
Discussion options

You must be logged in to vote

For this use case, specifically where the body might need to be consumed twice, we adapted the Either type in v3.3 to help: https://docs.rs/actix-web/3.3.1/actix_web/web/enum.Either.html#impl-FromRequest.

Try something like web::Either<web::Form<Test1>, web::Form<Test2>>.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dastardlychimp
Comment options

Answer selected by JohnTitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants