forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpMethods.cs
More file actions
37 lines (34 loc) · 1.17 KB
/
HttpMethods.cs
File metadata and controls
37 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using ServiceStack.ServiceHost;
namespace ServiceStack.Common.Web
{
public static class HttpMethods
{
public const string Get = "GET";
public const string Put = "PUT";
public const string Post = "POST";
public const string Delete = "DELETE";
public const string Head = "HEAD";
public const string Options = "OPTIONS";
public const string Patch = "PATCH";
public static EndpointAttributes GetEndpointAttribute(string httpMethod)
{
switch (httpMethod.ToUpper())
{
case Get:
return EndpointAttributes.HttpGet;
case Put:
return EndpointAttributes.HttpPut;
case Post:
return EndpointAttributes.HttpPost;
case Delete:
return EndpointAttributes.HttpDelete;
case Patch:
return EndpointAttributes.HttpPatch;
case Head:
return EndpointAttributes.HttpHead;
}
return EndpointAttributes.None;
}
}
}