Fetch to POST form data as JSON to your API

https://simonplend.com/how-to-use-fetch-to-post-form-data-as-json-to-your-api/