I am trying to send data with axios but it sends a response that is not expected. When I use postman to make the same request,it successfully sends a notification to my phone, here is the postman response:
{
"status": 200,
"success": true,
"message": "Notification sent to your phone to make payment",
"data": null
}
but with axios, the notification is not sent to my phone, here is the axios response:
{
status: 200,
success: true,
message: 'Tickets Sold Out',
data: null
}
Here is my axios code:
const postData = {
totalSum: 5000,
event_id: 7,
phone_number: '1298515352'
};
let axiosConfig = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
"Access-Control-Allow-Origin": "*",
}
};
axios({
method: 'post',
url: 'url',
headers: axiosConfig,
data: postData
})
.then((res) => {
const message = res.data;
console.log(message);
})