شاید پاسخ شما همینجا باشد
@hesammousavi
آخه من همین URL رو توی مرورگر میزنم و بهم برمیگردونه . توی برنامم که react js هست این خطا رو مییده
@md.tavangar
من از React js دارم استفاده میکنم . نیتیو نیست
axios.post("http://roocket.org/api/login", {
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept':'application/json',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Methods':'GET, POST, OPTIONS, PUT, PATCH, DELETE',
'Access-Control-Allow-Headers':'Origin, X-Requested-With, Content-Type, Accept',
},
body: JSON.stringify({
email, password
})
}).then((response) => {
console.log(response);
}).catch(error => {
console.log(error);
});
}
من به روش های مختلف نوشتم نمیدونم چرا خطا میده همیشه. خطای network error چیه واقعا
axios.post('http://roocket.org/api/login', {
logs: JSON.stringify({email, password})
}, {
headers: {
'Content-Type': 'application/json'
}
}).then(res=>{
console.log(res);
}).catch(err => {
console.log(err);
})