Witam mam problem z dodaniem przez fetch() 'post' do JSON nowej pozycji, a dokładniej jak sobie console.log sprawdzam co zostało dodane to pokazuje tylko i wyłącznie id. Status: 201 więc przechodzi, ale nie dodaje pozycji z "body". Poniżej dodaje Kod:
addSingleUser = (e) => {
e.preventDefault();
let name = this.firstNameInp.value;
let email = this.emailInp.value;
var url = 'https://jsonplaceholder.typicode.com/users';
fetch(url, {
method:'POST',
headers: {
'Accept': 'aplication/json, text/plain, */*',
'Content-type':'aplication/json'
},
body:JSON.stringify({name:"just test", email:"testing"})
})
.then(resp => resp.json())
.then(data => console.log(data))
}