Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created July 15, 2015 01:53
Show Gist options
  • Save dcomartin/b8aebc5c866b0b8c2a98 to your computer and use it in GitHub Desktop.
Save dcomartin/b8aebc5c866b0b8c2a98 to your computer and use it in GitHub Desktop.
Owin Selfhost
using System.Collections.Generic;
using System.Web.Http;
namespace AspNetSelfHostDemo
{
public class DemoController : ApiController
{
// GET api/demo
public IEnumerable<string> Get()
{
return new string[] { "Hello", "World" };
}
// GET api/demo/5
public string Get(int id)
{
return "Hello, World!";
}
// POST api/demo
public void Post([FromBody]string value)
{
}
// PUT api/demo/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/demo/5
public void Delete(int id)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment