I am facing an issue where the $http POST method is not returning the expected response. The required data is located within config instead of data
This is my Http POST request:
for (var i = 0; i < filmService.filmData.length; i++) {
filmData.push({
title : filmService.filmData[i].title,
overview : filmService.filmData[i].info,
poster : filmService.filmData[i].poster,
genres : filmService.filmData[i].genres,
release : filmService.filmData[i].release
});
}
var data = angular.toJson(filmData[0]);
$http({
method: 'POST',
url:'/search',
data: data,
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
}).then(function successCallback(response) {
console.log(response); //response received
});
The response appearing in RED in the console contains the required data: