Can OData Action return HttpResponseMessage?

Topics: ASP.NET Web API
May 29, 2013 at 3:08 PM

I want to add an action that will return binary(image for example) content, if I would use a GET api I would return HttpResponseMessage, is it possible to do something like that with an action?

May 29, 2013 at 3:48 PM
Absolutely! The simplest way to achieve your scenario is probably to return an HttpResponseMessage with a custom HttpContent that contains the image.

Daniel Roth
Jun 2, 2013 at 2:33 PM