Created
December 21, 2020 16:59
-
-
Save rotimi-best/26a85b82b602987a7fc1bc66b2c28d1f to your computer and use it in GitHub Desktop.
Basic fetch request
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
fetch('https://httpbin.org/post', { | |
method: 'POST', | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({a: 1, b: 'Textual content'}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment