I have an MVC WEB API service and i want to send every response as an HttpResponseMessage.
This case i have a class looking like this:
public class Quota
{
public int docs_quota { get; set; }
public int pages_quota { get; set; }
public int size_quota { get; set; }
}
in the response’s content i want to send a Quota object, but i don’t want to serialize it by myself, i want to let the service do it, so i don’t have to bother if it’s serialized as json or xml.
How can i do that?
Sincerely,
Zoli
Eventually, i found it out, it’s pretty easy:
It will return with a statuscode 200(okay) and the q will be serialized in json/xml in the content.