How to return JSON from a odata method

Hi,

I created a a serveur method named COCO_MONITORING returning a JSON like this

var innovator = this.getInnovator();
var output= new Newtonsoft.Json.Linq.JObject();
....
return innovator.newResult(output.ToString(Newtonsoft.Json.Formatting.None));

I'm able to call it in odata like this:
https://serveur/1Z62innovator/server/odata/method.COCO_MONITORING

My problem is that the output of the web service is a text/plain containing the json as a text.

I would like to have directly the json (application/json).

How can I do that ?

Parents Reply Children
No Data