Oracle REST Data Services on Oracle APEX to interact with my database. Everything works fine and all data is returned as JSON as expected.
However, when the request is invalid (e.g. a missing parameter), the REST API returns a HTML document instead of an error message in JSON or text.
Reading HTML documents inside my error logs is a pain to debug.
I tried the headers Accept: application/json
and Content-Type: application/json
without success.
How to make error messages return as JSON?