Skip to content

Commit

Permalink
Expose other HTTP methods for not-OK controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
sixeyed committed Sep 12, 2014
1 parent e05a2e2 commit 6ab647e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Expand Up @@ -21,8 +21,8 @@
var statusCode = (int)statusDescription;
var domainUrl = "http://" + statusCode + ".badapi.net";
<tr>
<td class="api-name">GET http://badapi.net/@api.RelativePath.ToLower()</td>
<td class="api-name">GET @domainUrl</td>
<td class="api-name">@api.HttpMethod.Method http://badapi.net/@api.RelativePath.ToLower()</td>
<td class="api-name">@api.HttpMethod.Method @domainUrl</td>
<td class="api-documentation">
<p>Returns @statusCode: @statusDescription</p>
</td>
Expand Down
Expand Up @@ -5,7 +5,7 @@ namespace Sixeyed.BadApi.Web.Spec
{
public interface IResponseMessageController
{
IHttpActionResult Get();
IHttpActionResult Any();

HttpStatusCode ResponseStatusCode { get; }
}
Expand Down
Expand Up @@ -9,7 +9,12 @@ public abstract class ResponseMessageController : ApiController, IResponseMessag
{
public abstract HttpStatusCode ResponseStatusCode { get; }

public IHttpActionResult Get()
[HttpGet]
[HttpPost]
[HttpPut]
[HttpDelete]
[HttpHead]
public IHttpActionResult Any()
{
return ResponseMessage(new HttpResponseMessage(ResponseStatusCode));
}
Expand Down

0 comments on commit 6ab647e

Please sign in to comment.