Skip to content

Instantly share code, notes, and snippets.

@enzzoperez
Created November 22, 2018 17:47
Show Gist options
  • Save enzzoperez/419a52fca11eda0c7152eb201654d880 to your computer and use it in GitHub Desktop.
Save enzzoperez/419a52fca11eda0c7152eb201654d880 to your computer and use it in GitHub Desktop.
(async () => {
const rawResponse = await fetch('https://httpbin.org/post', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({a: 1, b: 'Textual content'})
});
const content = await rawResponse.json();
console.log(content);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment