Problems with REST test

I’m trying to create a very simple REST example as an exercise. My end point returns a json formatted response like this :

{"second":2,"first":"value1"}

On page load, my endpoint logging shows that it was called correctly and that it responded with the above. This suggests that my “invoke” works fine on the page.load event.

However, the “Error” path (which is set to show a notification) is triggered.

My question is how can I show something meaningful in that error path? I cannot find out how to display what the error was and therefore debugging is somewhat challenging :slight_smile:

Hi @DavidWylie,

The Error event of the Invoke triggers when the response status code is not successful. You can do one of the following to troubleshoot:

  1. Check the status code and response in your browser developer tools (the Network tab).
  2. Handle the Error event with an Execute JavaScript and use console.log(${result}) to log the response to the browser console.
1 Like

Ah ok, I wrongly assumed it was going to be a “Radzen” error that I would need to display in that error branch.

Turns out I needed “Pragma, Cache-Control, Expires” in the Access-Control-Allow-Headers.

Thanks for that. Works perfectly now.