Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

How to invoke error on REST response

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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to invoke error on REST response

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...

Return to “Issues”