JSFiddle - React, Tailwind, and code Playground
by Vladymyr Shevchuk
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
JavaScript
(async () => {
let user = {
name: 'John',
surname: 'Smith'
};
let response = await fetch('https://learn.javascript.ru/article/fetch/post/user', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(user)
});
let result = await response.json();
console.log(result);
})();