Skip to content

Instantly share code, notes, and snippets.

@jrusbatch
Created September 8, 2012 20:26
Show Gist options
  • Save jrusbatch/3679448 to your computer and use it in GitHub Desktop.
Save jrusbatch/3679448 to your computer and use it in GitHub Desktop.
/**
* Both of the below methods are valid actions in an ApiController, and both would result in the
* same response being sent to the client.
**/
// GET api/strings
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/strings
public HttpResponseMessage Get()
{
return Request.CreateResponse(HttpStatusCode.OK, new[] { "value1", "value2" });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment