Open mbaeten opened 6 years ago
I'm not sure there is good way in serde to allow it, but maybe you could try untagged union of two forms? https://serde.rs/enum-representations.html#untagged
Other than that you should be able to get body of request by accepting String
https://actix.rs/actix-web/actix_web/trait.FromRequest.html#impl-FromRequest%3CS%3E-1 or bytes::Bytes
for raw bytes
I am actually think this idea might make sense
I think it can be resolved by serde
alone though? 😄
Idea is to be able to create multiple handlers for matched route, with different set of extractors
Hey, first I want to thank you for your great work. Maybe there's a simple solution to this that i missed.
I would like to handle multiple/different forms on the same URL.
If you submit form 2, it seems that the first POST resource (form1) is chosen and then fails ungracefully to execute (because struct Form1 does not match the POST data). If a route is chosen, it should always be able to execute it, don't you think so, too?
Is there a way to forward all POST data to the called function so that I can handle it on my own?
Relevance: If parts of the Form depend on the user's selections (dynamically created Form fields), you cannot know beforehand which data will be sent to the server.
Example: