ORDS: Returning Raw {JSON}

ORDS is nice.

It auto-formats your SQL or PL/SQL results and response to JSON before returning to your client or application.

But what if you’re response is ALREADY in JSON?

Like this:

Oracle can be your JSON DB, seriously.

Bad

ORDS trying to convert JSON to JSON

Yuck.

Good

You telling ORDS we’re not just dealing with a CLOB, it’s actually JSON.

We’ve talked about the MEDIA stuff before.

Here’s that media post…
The Media resource in this case is application/json – and we’re going to let the browser handle that, just like it would a BLOB and a PDF. We just need to include the heads-up notice saying what it actually is, so adjust your GET query text to include ‘application/json’ before you include the JSON itself.

Ta-da!

关注dbDao.com的新浪微博

扫码加入微信Oracle小密圈,了解Oracle最新技术下载分享资源

TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569