Created
January 7, 2016 10:13
-
-
Save andreasderuiter/1542af70d626f2593b46 to your computer and use it in GitHub Desktop.
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
namespace bat_mvc.Controllers.api | |
{ | |
public class SampleController : ApiController | |
{ | |
// GET api/<controller> | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1", "value2" }; | |
} | |
// GET api/<controller>/5 | |
public string Get(int id) | |
{ | |
return "value"; | |
} | |
// POST api/<controller> | |
public void Post([FromBody]string value) | |
{ | |
} | |
// PUT api/<controller>/5 | |
public void Put(int id, [FromBody]string value) | |
{ | |
} | |
// DELETE api/<controller>/5 | |
public void Delete(int id) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment