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

161
Views
Fetch data from Api in react

I want to fetch the data from this api (refer the screenshots) in reactjs using fetch function..I tried different ways but none of them is working

I am doing this way

useEffect(() => {
    // POST request using fetch inside useEffect React hook
    const requestOptions = {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ "firebase_id":"fonnnnjnvQXzyOcXK5kW88PM8jnjnhnhb1"})
    };
    fetch('demo.revon.com/audi/zero/li', requestOptions)
        .then(response => response.json())
        .then(data =>  console.log(data));                 
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

requestOptions is not the issue here!


You are OBVIOUSLY hitting the localhost domain, not demo.revon.
Insert the full URL: https://demo.revon.com/audi/zero/li

about 4 years ago · Juan Pablo Isaza Report

0

You should try to call your API without https://localhost:3000 in front of your API link.

You forgot to put HTTP or HTTPS so it consider a subfolder of localhost:3000.

You must do something like that : (or http if not https)

fetch('https://demo.revon.com/audi/zero/li', requestOptions)
        .then(response => response.json())
        .then(data =>  console.log(data));    

Regards

about 4 years ago · Juan Pablo Isaza Report

0

You’ll need to mention https:// in the fetch url

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!