I am working on AJAX. I create a post request like the following :
$.ajax({
'url':'http://localhost/api/create/',
'method':'POST',
'dataType': 'json',
'contentType': 'application/json',
'data':{
"refId":585,
"phone":"0674444444"
},
'success': getHandlingStatus
});
When my request is executed, data are passed as parameters in my request payload and not as JSON data. Here is my Request Payload:
refId=585&phone=0674444444
I want to send data in json format like :
{
"refId":"585",
"phone:"0674444444"
}
What am I missing please ?