Created
August 28, 2022 14:44
-
-
Save alexlatam/d982ad14f642a9862b222680241e1b04 to your computer and use it in GitHub Desktop.
Script para consultar con JavaScript nativo a una api, usando async await
This file contains hidden or 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
// Hago el llamado al endpoint, y obtengo al respuesta | |
const response = await fetch(API_URL); | |
// Paso la informacion de string, a formato JSON | |
const data = response.json(); | |
// Ahora con la data que retorna el endopoint, puedo procesarlo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment