Different Form extractors; same route #1800
-
I'm migrating an old api request into actix web, and I need to keep the same interface. The request allowed two different request structures through Code with two optional
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
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>>
.