The community member is trying to submit a webhook form with a JSON payload, but the form is currently submitting with a text/plain;charset=UTF-8 content type, which is not compatible with the Directus API that requires JSON. Other community members respond that HTML forms generally do not support JSON content types, but they are working on a solution to enable this functionality. They mention creating an issue on the Directus repository and on their own project's repository to track this feature request. The community members discuss the importance of being able to send and receive JSON data through forms, as it will greatly expand the capabilities of forms. They also mention that this feature is a side priority compared to their current focus on CSS variables, but they are considering prioritizing it depending on the complexity involved.
It looks like the webhook form submits with content-typetext/plain;charset=UTF-8. Is there a way to have it submit with content-typeapplication/json? I'm playing with using Directus to receive form submissions, and it requires a JSON payload
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
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
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