Skip to content

Instantly share code, notes, and snippets.

@andreasderuiter
Created January 7, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasderuiter/1542af70d626f2593b46 to your computer and use it in GitHub Desktop.
Save andreasderuiter/1542af70d626f2593b46 to your computer and use it in GitHub Desktop.
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