Created
June 1, 2020 02:08
-
-
Save parzibyte/292da0964d1048c26ac2429d5b108a8a to your computer and use it in GitHub Desktop.
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 datos = { | |
nombre: "Luis Cabrera Benito", | |
web: "parzibyte.me", | |
}; | |
const respuestaRaw = await fetch("http://sitio.com", { | |
body: JSON.stringify(datos), // <-- Aquí van los datos | |
headers: { | |
"Content-Type": "application/json", // <-- Importante el encabezado | |
}, | |
method: "POST", | |
}); | |
const jsonDecodificado = await respuestaRaw.json(); | |
console.log(jsonDecodificado); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment