Reading JayData from an OData controller throws an ODataContentTypeException

I have an ODataController that seems to be working fine if I just do a GET through my browser. But when I use JayData for reading, I get 500 back. I see that GetItems () is called in my ODataController and returns a valid list of elements. I, but I see several ODataContentTypeException exceptions that have the following message:

Additional Information: Could not find a supported MIME type matching the response content type. None of the supported types are 'application / atom + xml; type = feed, application / atom + xml, application / json; odata = verbose, application / json 'matches the content type' application / json; OData = fullmetadata; encoding = UTF-8 '.

Then

Additional Information: Could not find a supported MIME type matching the response content type. None of the supported types are 'application / atom + xml; type = feed, application / atom + xml, application / json; odata = verbose, application / json 'matches the content type' application / json; OData = fullmetadata; encoding = UTF-8 '.

Then

Additional Information: Could not find a supported MIME type matching the response content type. None of the supported application types (types) / xml, application / json; odata = verbose, application / json 'does not match the content type' application / json; OData = fullmetadata; encoding = UTF-8 '.

And finally

Additional Information: Could not find a supported MIME type matching the response content type. None of the supported application types (types) / xml, application / json; odata = verbose, application / json 'does not match the content type' application / json; OData = fullmetadata; encoding = UTF-8 '.

, 500, , , , . Chrome, :

: application/atomvc + xml; q = 0.8, application/json; odata = fullmetadata; q = 0.7, application/json; q = 0.5,/;q=0.1

Accept-Encoding: GZIP, , SDCH

500 - , . - ?

Accept-Language: EN-US, , Q = 0,8, -CA; = 0,6

+3
1

, , : MVC5 WebAPI 2.0 OData nuget 5.0

- JayData OData v2. , , , V3.

, maxDataServiceVersion: "3.0".

:

dbContext = new MyEntities({ name: 'oData', oDataServiceHost: '/odata' }));

:

dbContext = new MyEntities({ name: 'oData', oDataServiceHost: '/odata', maxDataServiceVersion: '3.0' }));

.

, JayStack .

+4

All Articles