REST API live demo
csv = $('#publishedCSV').val();
fetch("/api/?csv=" + encodeURIComponent(csv))
.then(response => response.json())
.then(data => $('#output').text(JSON.stringify(data, null, 2)));
OR
data.csv = $('#publishedCSV').val();
fetch("/api", { method: 'POST', mode: 'cors',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => $('#output').text(JSON.stringify(data, null, 2)));
JSON will appear here