I try to get the output XML or JSON data based on my input. I used the below WEB API code but not able to exact output.
public string Get(int id)
{
if (G
It also works to force the accept headers. Great option if you aren't always returning HttpResponseMessage's
. I.e
Request.Headers.Add("Accept", "text/json");
return Request.CreateResponse(HttpStatusCode.OK, yourobject);
or
Request.Headers.Add("Accept", "application/xml");
return new Rss20FeedFormatter(feed);