I'm frustrated of AngularJS and Laravel 5.2.
I want to do a normal $http post request with:
APIservice.saveArticle = function ( oArticle, callback )
{
var message = 'Hello World!';
$http({
method: 'POST',
url: sBaseUrl + '/api/dummy/',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $.param({ 'message' : message })
});
}
If I now try to call this route in postman (POST + URL/api/admin) I can see under the Tab Headers that the content-type is text/html.
So I edited the module config:
artikelportal.config(
[
'$httpProvider',
function( $httpProvider )
{
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
}
]);
This still won't work. And my Backend Controller also gets no data:
Route::post('api/dummy',
function ( Request $request )
{
var_dump(json_decode(file_get_contents('php://input'), true)); // NULL
var_dump($_POST); // EMPTY
}
);
What I'm doing wrong? I've tried such a lot but I never got this working...does anybody know what's the problem?

dd($request->all());