I am trying to use the data sent cia the following JQuery POST:
$.ajax({
type: 'POST',
data : JSON.stringify({
'email' : 'test@example.com',
'password' : 'mypassword'
}),
url: 'http://example/api/login',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
success: function(data){
//If the response is successful
if (data.status)
{
} else {
}
}
});
In Zendframework / ApiGility I would traditionally do something along these lines to grab the information being sent:
$email = (string) $this->params()->fromPost('email',false);
Although this is not working with jQuery
Any ideas?