fetch('http://3.108.170.236/erp/apis/login_otp.php', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
monumber: '8770276989',
}),
})
.then(async response => {
console.log('fetching api');
console.log(await response.json());
return await response.json();
})
.catch(err => {
console.log('fetch error' + err);
});
postman api output
[{"otp_value":665354,"student_id":"3117"}]
getting error of 405 method not allowed. i am sending data in post format with plain text and api response is in json what should i do get proper value.
Thanking you advance community.