fetch(url, {
method: 'POST',
headers: {},
mode: 'cors',
body: JSON.stringify(data)
}).then(res => {
if (res.status === 200){
return res.json()
} else {
return Primise.reject(res.json())
}
}).then(data => {
console.log(data)
}).catch(err=>{
console.error(err)
})