Skip to main content
July 18, 2024
Question

Configure custom body for http 404 error

  • July 18, 2024
  • 2 replies
  • 0 views

Hello.

My question is, can I change the default body for the 404 NOT FOUND error? Appian default response looks like this:

If I want to return a custom JSON instead of the text "404 - Not Found", can I do that? Is possible to change the default body errors for the 404 or others http errors?

Thanks in advance!

2 replies

davidj137213
July 18, 2024

The problem is that a 404 is a not found error.. in that case, the code in your web api will never be executed, so you don't have control over the response.... sorry

Once your wep api is executed, you can control the error returned via HttpResponse.

July 18, 2024

I suspected it, but I thought that maybe I can change the response in a internal file in the Appian server or something like that, but I assume that it's impossible. Many thanks!