Nested form objects POST
My form has nested objects and array of objects. I name them as below -
How can I read them back as json at server side? It all works fine if body has flat structure. Am I missing any middleware
3 Replies
Can you provide server side code since it’s the issue ?
Server side code was
It was failing the zod validation saying no nested object present. I googled more and found that this is where the world abondons the HTML form post
https://www.reddit.com/r/webdev/comments/ug13uc/how_can_i_make_post_request_with_nested_form_data/
I also went back to usual way of start sending body as
application/json
and start calling the server POST manually with fetch
.Yeah i try to avoid to use form as much as possible and use json most of the time except for files