Fetch API & Handling JSON Responses
Why is it necessary to use JSON.stringify() on the request body?
const data = { username: 'john' };
fetch('/api/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
});