6
6
namespace Microsoft . AspNetCore . Http
7
7
{
8
8
/// <summary>
9
- /// Contains methods to verify the request method of an HTTP request.
9
+ /// Contains methods to verify the request method of an HTTP request.
10
10
/// </summary>
11
11
public static class HttpMethods
12
12
{
@@ -18,18 +18,45 @@ public static class HttpMethods
18
18
// and allow us to optimize comparisons when these constants are used.
19
19
20
20
// Please do NOT change these to 'const'
21
+ /// <summary>
22
+ /// HTTP "CONNECT" method.
23
+ /// </summary>
21
24
public static readonly string Connect = "CONNECT" ;
25
+ /// <summary>
26
+ /// HTTP "DELETE" method.
27
+ /// </summary>
22
28
public static readonly string Delete = "DELETE" ;
29
+ /// <summary>
30
+ /// HTTP "GET" method.
31
+ /// </summary>
23
32
public static readonly string Get = "GET" ;
33
+ /// <summary>
34
+ /// HTTP "HEAD" method.
35
+ /// </summary>
24
36
public static readonly string Head = "HEAD" ;
37
+ /// <summary>
38
+ /// HTTP "OPTIONS" method.
39
+ /// </summary>
25
40
public static readonly string Options = "OPTIONS" ;
41
+ /// <summary>
42
+ /// HTTP "PATCH" method.
43
+ /// </summary>
26
44
public static readonly string Patch = "PATCH" ;
45
+ /// <summary>
46
+ /// HTTP "POST" method.
47
+ /// </summary>
27
48
public static readonly string Post = "POST" ;
49
+ /// <summary>
50
+ /// HTTP "PUT" method.
51
+ /// </summary>
28
52
public static readonly string Put = "PUT" ;
53
+ /// <summary>
54
+ /// HTTP "TRACE" method.
55
+ /// </summary>
29
56
public static readonly string Trace = "TRACE" ;
30
57
31
58
/// <summary>
32
- /// Returns a value that indicates if the HTTP request method is CONNECT.
59
+ /// Returns a value that indicates if the HTTP request method is CONNECT.
33
60
/// </summary>
34
61
/// <param name="method">The HTTP request method.</param>
35
62
/// <returns>
@@ -41,7 +68,7 @@ public static bool IsConnect(string method)
41
68
}
42
69
43
70
/// <summary>
44
- /// Returns a value that indicates if the HTTP request method is DELETE.
71
+ /// Returns a value that indicates if the HTTP request method is DELETE.
45
72
/// </summary>
46
73
/// <param name="method">The HTTP request method.</param>
47
74
/// <returns>
@@ -53,7 +80,7 @@ public static bool IsDelete(string method)
53
80
}
54
81
55
82
/// <summary>
56
- /// Returns a value that indicates if the HTTP request method is GET.
83
+ /// Returns a value that indicates if the HTTP request method is GET.
57
84
/// </summary>
58
85
/// <param name="method">The HTTP request method.</param>
59
86
/// <returns>
@@ -65,7 +92,7 @@ public static bool IsGet(string method)
65
92
}
66
93
67
94
/// <summary>
68
- /// Returns a value that indicates if the HTTP request method is HEAD.
95
+ /// Returns a value that indicates if the HTTP request method is HEAD.
69
96
/// </summary>
70
97
/// <param name="method">The HTTP request method.</param>
71
98
/// <returns>
@@ -77,7 +104,7 @@ public static bool IsHead(string method)
77
104
}
78
105
79
106
/// <summary>
80
- /// Returns a value that indicates if the HTTP request method is OPTIONS.
107
+ /// Returns a value that indicates if the HTTP request method is OPTIONS.
81
108
/// </summary>
82
109
/// <param name="method">The HTTP request method.</param>
83
110
/// <returns>
@@ -89,7 +116,7 @@ public static bool IsOptions(string method)
89
116
}
90
117
91
118
/// <summary>
92
- /// Returns a value that indicates if the HTTP request method is PATCH.
119
+ /// Returns a value that indicates if the HTTP request method is PATCH.
93
120
/// </summary>
94
121
/// <param name="method">The HTTP request method.</param>
95
122
/// <returns>
@@ -101,7 +128,7 @@ public static bool IsPatch(string method)
101
128
}
102
129
103
130
/// <summary>
104
- /// Returns a value that indicates if the HTTP request method is POST.
131
+ /// Returns a value that indicates if the HTTP request method is POST.
105
132
/// </summary>
106
133
/// <param name="method">The HTTP request method.</param>
107
134
/// <returns>
@@ -113,7 +140,7 @@ public static bool IsPost(string method)
113
140
}
114
141
115
142
/// <summary>
116
- /// Returns a value that indicates if the HTTP request method is PUT.
143
+ /// Returns a value that indicates if the HTTP request method is PUT.
117
144
/// </summary>
118
145
/// <param name="method">The HTTP request method.</param>
119
146
/// <returns>
@@ -125,7 +152,7 @@ public static bool IsPut(string method)
125
152
}
126
153
127
154
/// <summary>
128
- /// Returns a value that indicates if the HTTP request method is TRACE.
155
+ /// Returns a value that indicates if the HTTP request method is TRACE.
129
156
/// </summary>
130
157
/// <param name="method">The HTTP request method.</param>
131
158
/// <returns>
@@ -156,7 +183,7 @@ string _ when IsConnect(method) => Connect,
156
183
} ;
157
184
158
185
/// <summary>
159
- /// Returns a value that indicates if the HTTP methods are the same.
186
+ /// Returns a value that indicates if the HTTP methods are the same.
160
187
/// </summary>
161
188
/// <param name="methodA">The first HTTP request method to compare.</param>
162
189
/// <param name="methodB">The second HTTP request method to compare.</param>
0 commit comments