async function(){
const data = document.getElementById("myForm");
const fd = new FormData(data);
let data = Object.fromEntries(fd);
const json = await ky.post('/test', {json: data}).json();
console.log(json.x);
....
<form id="myForm">
<input name="value1" />
</form>