I am trying to request a GET using SSC ODataController with Sitecore 8.2 and it keeps throwing a 406 Not Acceptable error. URL - http://sc82/sitecore/ssc/api/example-controller/products
This is the sample ODataController code:
public class ProductsController : ServiceBaseODataController<Product>
{
protected IReadOnlyEntityRepository<Product> ProductRepository { get; private set; }
public ProductsController(IReadOnlyEntityRepository<Product> repository) : base(repository)
{
}
public ProductsController() : this(new ProductRepository())
{
}
public override async Task<IHttpActionResult> Get()
{
IQueryable<Product> result = await ProductRepository.GetData();
return Ok(result);
}
}
Please let me know if anyone has tried using ODataController with Sitecore 8.2 and faced similar issue.