Created
October 7, 2022 10:39
-
-
Save revolunet/10b520b49ba922114c5fdeba34c4e8bd to your computer and use it in GitHub Desktop.
sample NodeJS fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require("node-fetch"); | |
fetch("https://api.insee.fr/entreprises/sirene/V3/siren?q=michelin", { | |
method: "POST", | |
headers: { | |
Accept: "application/json" | |
} | |
}).then(response => responses.json()).then(payload => { | |
console.log(payload); | |
}).catch(error => { | |
console.error(error); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment