Page 1 of 1

How to invoke error on REST response

Posted: Wed Jun 25, 2014 7:33 pm
by Alan Smith

Hi

I have created a simple login feature that queries an external database using PHP.

But how do I specify in the response if its an error or a success? So far I've tried a whole host of things but I cant find any documentation.

I am creating a response like this (although I have tried many variations):

$response = array('Response' = "success")
$response = array('Response' = "error")

So in appery, I have created an event for success and an event for failure, but it always returns success? I cant get the error event to fire.

What is the JSON response I would need to send in order to fire a success and failure?


How to invoke error on REST response

Posted: Wed Jun 25, 2014 7:58 pm
by Evgene Karachevtsev

Hello Alan,

Error event works in following cases:
1) there is no response from server
2) not valid answer from server (for example json is specified in the settings and not valid json is received)
3) error Status Code in response header. see http://www.w3.org/Protocols/rfc2616/r...