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

224
Vistas
Request with javascript Fetch API returns "object error"

I am trying to learn how to request JSON data with the javascript Fetch-API to fetch data from an open data portal called CKAN

Following the google documentation I tried this code:

fetch('https://ckan.open.nrw.de/api/3/action/package_list')
 .then(
  function(response) {
  if (response.status !== 200) {
    console.log('Looks like there was a problem. Status Code: ' +
      response.status);
    return;
  }

  // Examine the text in the response
  response.json().then(function(data) {
    console.log(data);
  });
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});

This function catches an object Error (when opening the URL in my browser, I get a valid JSON):

"Fetch Error :-S", [object Error] { ... }

What is the probleme here?

Here is a working jsfiddle

Thanks for your help!

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