Skip to Main Content

DevOps, CI/CD and Automation

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!

How to set Accept header to application/json for all interactions in a oj.Collection

Jaco Verheul-OracleMay 3 2016 — edited May 10 2018

Hi,

Using JET 2.0.1, I managed to set the Accept header to application/json for the first request to a REST service like this:

            self.collection = new claimsCollection();
            self.collection.fetch({headers: {Accept: "application/json"}});
            var datasource = new oj.CollectionTableDataSource(self.collection);
            self.pagingDatasource = new oj.PagingTableDataSource(datasource);

However, when going to the next page, the second request has an Accept header like this "application/json, text/javascript, */*; q=0.01"

And my REST back-end cannot handle that

is there an option to set the Accept to application/json for all interactions?

Jaco

Application Architect

Oracle Health Insurance

Comments
Post Details
Added on May 3 2016
6 comments
1,149 views