I'm trying to get a Fetch request in a Svelte component working. It works fine if I use curl and Postman. It looks like my headers may be wrong. Any ideas on what I'm doing wrong here?
This is the curl request:
curl -XPOST http://127.0.0.1:8000/parse --data 'locale=en_GB&text=Monday'
These are the headers set in Postman

And my code:
function handleClick() {
const url = "http://127.0.0.1:8080/parse"
fetch(url, {
mode: 'no-cors',
method: "POST",
headers: { 'Content-type': 'application/x-www-form-urlencoded'},
data: new URLSearchParams({
locale: "en_GB",
text: "Monday"
})
})
.then(console.log("test"))
.then((response) => {
console.log(response);
response.json().then((data) => {
console.log("data");
})
})
.catch((error) => {
console.log(error)
});
}