Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda