Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
What headers do I need to set to get in my Fetch Request?

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 enter image description here

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)
    });
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!