Could anyone tell me why the following statement does not send the post data to the designated url? The url is called but on the server when I print $_POST - I get an empty
Similar to the OP's suggested working format & Denison's answer, except using $http.post
instead of just $http
and is still dependent on jQuery.
The good thing about using jQuery here is that complex objects get passed properly; against manually converting into URL parameters which may garble the data.
$http.post( 'request-url', jQuery.param( { 'message': message } ), {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});