Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebApi Odata: remove metadata from response

I'm developing an WebApi Odata service for internal usage. I want to remove from response at server all additional data except serialized data. I want to remove all this stuff:

{
  "@odata.context":"http://192.168.150.86:9933/odata/$metadata#Terminal","value":[

  ]
}

and leave here only array of "Terminal"

is there any way to do this?

like image 259
Timur Lemeshko Avatar asked Feb 08 '23 17:02

Timur Lemeshko


1 Answers

Add the following option to your query string:

$format=application/json;odata.metadata=none

This will remove the odata metadata from your results.

like image 115
John C Avatar answered Mar 20 '23 20:03

John C