Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get REST API Error Messages With Content-type “application/json”

User_WWDPJJul 13 2021

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?

Comments
Post Details
Added on Jul 13 2021
2 comments
1,144 views