Created
December 8, 2022 21:37
-
-
Save irvingvjuarez/3d9b497efa32673fe8cdf8e3bd67bd04 to your computer and use it in GitHub Desktop.
Main structure to make a post fetch in js
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 fetchConfig = { | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
method: "POST", | |
body: JSON.stringify(data) | |
} | |
fetch(API, fetchConfig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment