Join the Webstudio community

Updated 4 weeks ago

Json form

It looks like the webhook form submits with content-type text/plain;charset=UTF-8. Is there a way to have it submit with content-type application/json? I'm playing with using Directus to receive form submissions, and it requires a JSON payload
O
p
14 comments
Html forms in general don't support json content type, but we are cooking something to enable this and setting headers etc. basically using resource in forms
Awesome, thanks for getting back to me. When there's an issue for it, could you share a link?
There's a request on Directus for accepting other request bodies, but it's only a few days old https://github.com/directus/directus/issues/23143
yeah, it should be a good practice for any api endpoint to accept form encoding as well, but there is no consistency, so we really need to be able to send json too
awesome, thanks for planning this and setting up an issue!
With this done, Forms will become basically allmighty, especially once you can also bind response to any rendering
so not only sending, but also using the responses
I was wondering about exactly this! Fantastic. Is this going to be a next few weeks thing, or a later this year thing, do you think?
I am considering to prioritize it but it depends on @TrySound estimate of complexity
Our main priority right now is css variables, so its another side quest, but its so powerful, we need to do it
https://github.com/webstudio-is/webstudio/issues/3872 also follow this one, with this you can not only pass json data to the client-side scripts, but also once the forms fetch json, pass that json to client-side js and do anything with it that is completely custom
oh, this is great too. will really open up possibilities
Thank you for all the info, and also I'm very much looking fwd to css variables
Add a reply
Sign up and join the conversation on Discord