Please ignore previous message as I hit Send instead of Save (bloody Gmail
interface!). Here's the correct message:

Chaps, after some doodling around I see I can get the Accept values
straight out of the Request in the controller's code. That does now seem to
be the logical way of choosing the response format.

More confusion though ... I tried to write a controller method that
returned either plain text or XML, but the samples I've found return
different types. Here are the two samples:

public HttpActionResult Sample1()
return Ok("hello");

public HttpResponseMessage Sample2()
return new HttpResponseMessage() { Content = new StringContent("hello") };

The firsts returns <String>hello</String> and the second returns the plain
text "hello". But they're different return types and I can't figure out how
get one method to return Xml or text. Anyone know how. I'm still searching.

Greg K

Reply via email to