-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMethod.cs
68 lines (56 loc) · 1.9 KB
/
Method.cs
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.Collections.Generic;
namespace HttpServer
{
/// <summary>
/// HTTP methods.
/// </summary>
public static class Method
{
private static List<string> _supportedMethods = new List<string>
{
Post,
Get,
Put,
Delete,
Head,
Options
};
public static bool IsSupported(string name)
{
return _supportedMethods.Contains(name);
}
public static void AddMethod(string name)
{
_supportedMethods.Add(name);
}
public static IEnumerable<string> Methods { get { return _supportedMethods; }}
/// <summary>
/// Unknown method
/// </summary>
public const string Unknown = "";
/// <summary>
/// Posting data
/// </summary>
public const string Post = "POST";
/// <summary>
/// Get data
/// </summary>
public const string Get = "GET";
/// <summary>
/// Update data
/// </summary>
public const string Put = "PUT";
/// <summary>
/// Remove data
/// </summary>
public const string Delete = "DELETE";
/// <summary>
/// Get only HTTP headers.
/// </summary>
public const string Head = "HEAD";
/// <summary>
/// Options HTTP 1.1 header.
/// </summary>
public const string Options = "OPTIONS";
}
}