I'm trying to make a ajax request to a server php but angular is sending the data as string and there is not $POST in the php (the same works just fine with jquery ajax).
$scope.getPhotoFromUrl = function() {
var urlData = { url: 'http://google.com' };
$http({
method: 'POST',
url: "remotecopy.php",
data: urlData
}).success(function(data, status, headers, config) {
console.log('http' + data.url);
});
}
What am i doing wrong?
Angular is a strange beast :) but i find a fix for this.
enter code here
$http({
method: 'POST',
url: "remotecopy.php",
data: 'url=' + urlData,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
} ...