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

140
Views
La solicitud POST genera un error al obtener

Tengo problemas para realizar una solicitud POST a través de la API de obtención de javascript y aparece el siguiente error: TypeError: Failed to fetch at fetchCallImpp at window.fetch El código es el siguiente:

 const agregarCafetalDB = (nombre) => { const data = { "nombre": `${nombre}`, }; const requestOptions = { method: 'POST', body: JSON.stringify(data), redirect: 'follow', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' }, }; fetch(url, requestOptions) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.log('error', error)); } btnAgregar.addEventListener('click', (e) => { agregarCafetalDB(cafetal.value) });

quisiera que me ayuden a solucionar el error desde ya muchas gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Aparece el mismo error en otros navegadores? fetch es ES6 Javascript, tal vez el navegador que está utilizando no lo admita.

 fetch(url, requestOptions)

Además, asegúrese de que la variable 'url' esté definida.

about 4 years ago · Juan Pablo Isaza Report
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!