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

233
Views
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
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!