2

I just upgraded to Microsoft.AspNet.OData v6.0.0, and started encountering 406 status codes. I was able to fix most of them by changing using System.Web.Http.OData; to using System.Web.OData;, however I'm still having issues with custom error responses.

When an authorization/exception filter sets the response to my error response type, OData appears to convert whatever response I set into an empty 406 response.

How do I prevent this from happening so my filters can return custom error responses?

Brett Allen
  • 5,297
  • 5
  • 32
  • 62

2 Answers2

0

What are the headers on your request from the client, and what are the response type header on the response?

It may be the Accept header on the request does not include the response type returned from your endpoint. In request's Accept header include the proper response type.

M. Carlson
  • 788
  • 7
  • 17
0

may be you can't use a Get, you have to use a Post and define an Action to get what you want.

Hitesh Kalwani
  • 573
  • 5
  • 9