dunerdillon
New Member
I have an ODataController that is returning a PageResult.Api Example:\[code\]public PageResult<Customer> Get(ODataQueryOptions options) {// cut some stuff out... PageResult<Customer> result = new PageResult<Customer>( searchResults as IEnumerable<Customer>, Request.GetNextPageLink(), Request.GetInlineCount()); return result;\[/code\]When I debug this, it seems to be fine and have a PageResult class built up correctly to return. On the Web side..Web Example\[code\]using (var client = new HttpClient()) { client.BaseAddress = new Uri(testURL); string searchUrl = "api/customer?$top=1&$skip=0"; client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata=http://stackoverflow.com/questions/15625794/verbose")); HttpResponseMessage response = client.GetAsync(searchUrl).Result;\[/code\]The response is a StatusCode 406, with a reason phrase stating the content was not acceptable. It also does this if I define a new MediaTypeWithQualityHeaderValue("application/json").What do I need to change so that I successfully consume this Api in the controller before passing it on to the view?