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

248
Views
leer datos json de una url específica

quiero mostrar los datos dentro de esta url en mi nodo, pero no muestra ninguno, hay algo que hago mal en mi código

 const extractRefDefaultSchema = async (data) => { const url = "https://mos.esante.gouv.fr/NOS/TRE_R81-Civilite/FHIR/TRE-R81-Civilite/TRE_R81-Civilite-FHIR.json" https.get(url,(res) => { let body = ""; res.on("data", (chunk) => { body += chunk; }); res.on("end", () => { try { let json = JSON.parse(body); // do something with JSON } catch (error) { console.error(error.message); }; }); }).on("error", (error) => { console.error(error.message); }); console.log("extractRefDefaultSchema");

};

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

0

Puede usar la API de búsqueda para hacer esto:

 fetch(url) .then((res)=> res.json()) .then((json) => { let dataJson = JSON.parse(json) })

about 4 years ago · Juan Pablo Isaza Report

0

Puedes lograr lo mismo con axios , sería mucho más simple.

Código:

 let axios = require("axios") axios.get("https://mos.esante.gouv.fr/NOS/TRE_R81-Civilite/FHIR/TRE-R81-Civilite/TRE_R81-Civilite-FHIR.json").then((res) => { let jsonData = res.data })
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!