Last active
April 9, 2017 15:16
-
-
Save ignas-sakalauskas/bb4905388b12345a9e14986692883255 to your computer and use it in GitHub Desktop.
Dummy RESTful API
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.Net; | |
using Microsoft.AspNetCore.Mvc; | |
namespace WebApplication4.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class ValuesController : Controller | |
{ | |
[HttpGet] | |
public IActionResult Get() | |
{ | |
return Ok("get"); | |
} | |
[HttpPost] | |
public IActionResult Post() | |
{ | |
return Created("https://ignas.me", string.Empty); | |
} | |
[HttpPut] | |
public IActionResult Put() | |
{ | |
return Ok("put"); | |
} | |
[HttpDelete] | |
public IActionResult Delete() | |
{ | |
return StatusCode((int)HttpStatusCode.NoContent); | |
} | |
} | |
} | |
// https://ignas.me/tech/405-method-not-allowed-iis/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment