Skip to content

Instantly share code, notes, and snippets.

@joymon
Created May 21, 2015 19:21
Show Gist options
  • Save joymon/865a56b681425d389d06 to your computer and use it in GitHub Desktop.
Save joymon/865a56b681425d389d06 to your computer and use it in GitHub Desktop.
A simple web api controller for testing purpose
using System.Web.Http;
public class MyWebAPIController : ApiController
{
[AcceptVerbs("GET")]
public string Help()
{
return "This is test WEB API. Supported methods are ../api/MyWebAPI/Help, ../api/MyWebAPI/Square/{number}";
}
[AcceptVerbs("GET")]
public int Square(int id)
{
return id * id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment