I have strange Codeigniter - Angular issue. My idea was to set up controller to work like this:
- index is simple Angular page, just 1 app and 1 controller
- get is get data from database
- set is save data which are sent using $http.post
Problem is that $http.post()
send proper data, I see it in Firebug,
but CI doesn't catch that.
I change header parameters, tried to catch with file_get_contents("php://input")
and $this->input->post
, but always was Null
.
Any idea?
I tried this:
$http(
{
method: 'POST',
url: url,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: function (obj) {
var str = [];
for (var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
data: data
});
With and without headers and transformData changes... and nothing.
UPDATE
I tried to send same data to raw php script, and it's worked. so, somehow - Codeigniter blocking this.
Any idea ?