Created
October 26, 2020 20:50
-
-
Save allangrds/6d827347f8f68e52d384d9fe638fa6ea 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
// fetch() | |
const url = 'http://localhost/test.htm'; | |
const options = { | |
method: 'POST', | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json;charset=UTF-8' | |
}, | |
body: JSON.stringify({ | |
a: 10, | |
b: 20 | |
}) | |
}; | |
fetch(url, options) | |
.then(response => { | |
console.log(response.status); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment