Getting $_POST empty in AJAX callback
Solutions
Try something like this:
$.ajax({
url: Drupal.settings.property_check.base_url + '/search/property-by-address',
type: 'POST',
data: {
'add1':'address line1',
'add2':'address line2',
'add3':'address line3'
},
headers:{
'Content-Type': undefined,
}
}).done(function(response) {
console.log(response);
})
or
var address = {'add1':'address line1','add2':'address line2','add3':'address line3'};
$.ajax({
url: Drupal.settings.property_check.base_url + '/search/property-by-address',
type: 'POST',
data: address,
headers:{
'Content-Type': undefined,
}
}).done(function(response) {
console.log(response);
})