Created
May 21, 2015 19:21
-
-
Save joymon/865a56b681425d389d06 to your computer and use it in GitHub Desktop.
A simple web api controller for testing purpose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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