88 references to HttpMethod
Microsoft.AspNetCore.Server.Kestrel.Core (88)
BadHttpRequestException.cs (1)
20
internal BadHttpRequestException(string message, int statusCode, RequestRejectionReason reason,
HttpMethod
? requiredMethod)
Internal\Http\Http1Connection.cs (6)
446
var
method = versionAndMethod.Method;
472
if (method ==
HttpMethod
.Custom)
599
private void OnAuthorityFormTarget(
HttpMethod
method, Span<byte> target)
612
if (method !=
HttpMethod
.Connect)
650
private void OnAsteriskFormTarget(
HttpMethod
method)
656
if (method !=
HttpMethod
.Options)
Internal\Http\Http1MessageBody.cs (2)
224
if (httpVersion == HttpVersion.Http10 && (context.Method ==
HttpMethod
.Post || context.Method ==
HttpMethod
.Put))
Internal\Http\HttpParser.cs (2)
430
var
method = requestLine.GetKnownMethod(out var methodEnd);
431
if (method ==
HttpMethod
.Custom)
Internal\Http\HttpProtocol.cs (10)
148
public
HttpMethod
Method { get; set; }
378
Method =
HttpMethod
.None;
938
if (Method !=
HttpMethod
.Head &&
1117
if (Method ==
HttpMethod
.Head && _responseBytesWritten > 0)
1138
if (Method ==
HttpMethod
.Head && _responseBytesWritten > 0)
1261
Method ==
HttpMethod
.Connect &&
1309
else if (Method ==
HttpMethod
.Connect && Is2xxCode(StatusCode))
1325
return Method !=
HttpMethod
.Head &&
1335
Method !=
HttpMethod
.Head &&
1407
if (Method !=
HttpMethod
.Head)
Internal\Http\IHttpRequestLineHandler.cs (3)
36
public HttpVersionAndMethod(
HttpMethod
method, int methodEnd)
55
public
HttpMethod
Method => (
HttpMethod
)(byte)(_versionAndMethod >> 8);
Internal\Http2\Http2Stream.cs (7)
249
if (Method ==
HttpMethod
.None && !TryValidateMethod())
259
if (Method ==
HttpMethod
.Connect)
323
if (Method ==
HttpMethod
.Options && path.Length == 1 && path[0] == '*')
360
if (Method ==
HttpMethod
.None)
366
if (Method ==
HttpMethod
.Custom)
710
Method =
HttpMethod
.Get;
715
Method =
HttpMethod
.Post;
Internal\Http3\Http3Stream.cs (7)
22
using HttpMethod = Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.
HttpMethod
;
311
Method =
HttpMethod
.Get;
316
Method =
HttpMethod
.Post;
1107
if (Method ==
HttpMethod
.Connect && HttpRequestHeaders.HeaderProtocol.Count == 0)
1150
if (Method ==
HttpMethod
.Options && path.Length == 1 && path[0] == '*')
1187
if (Method ==
HttpMethod
.None)
1193
if (Method ==
HttpMethod
.Custom)
Internal\Infrastructure\HttpUtilities.cs (28)
33
private static void SetKnownMethod(ulong mask, ulong knownMethodUlong,
HttpMethod
knownMethod, int length)
35
_knownMethods[GetKnownMethodIndex(knownMethodUlong)] = new Tuple<ulong, ulong,
HttpMethod
, int>(mask, knownMethodUlong, knownMethod, length);
42
var invalidHttpMethod = new Tuple<ulong, ulong,
HttpMethod
, int>(_mask8Chars, 0ul,
HttpMethod
.Custom, 0);
207
public static bool GetKnownMethod(this ReadOnlySpan<byte> span, out
HttpMethod
method, out int length)
210
return method !=
HttpMethod
.Custom;
214
public static
HttpMethod
GetKnownMethod(this ReadOnlySpan<byte> span, out int methodLength)
222
return
HttpMethod
.Get;
242
return
HttpMethod
.Custom;
252
/// <returns><see cref="
HttpMethod
"/></returns>
253
public static
HttpMethod
GetKnownMethod(string? value)
274
return
HttpMethod
.None;
293
return
HttpMethod
.Custom;
335
static ReadOnlySpan<
HttpMethod
> Methods() =>
337
HttpMethod
.None,
338
HttpMethod
.None,
339
HttpMethod
.None,
340
HttpMethod
.Get,
341
HttpMethod
.Head,
342
HttpMethod
.Trace,
343
HttpMethod
.Delete,
344
HttpMethod
.Options,
345
HttpMethod
.Put,
346
HttpMethod
.Post,
347
HttpMethod
.Patch,
348
HttpMethod
.None,
349
HttpMethod
.Connect
470
public static string? MethodToString(
HttpMethod
method)
Internal\Infrastructure\HttpUtilities.Generated.cs (19)
35
private static readonly Tuple<ulong, ulong,
HttpMethod
, int>[] _knownMethods =
36
new Tuple<ulong, ulong,
HttpMethod
, int>[17];
42
SetKnownMethod(_mask4Chars, _httpPutMethodLong,
HttpMethod
.Put, 3);
43
SetKnownMethod(_mask5Chars, _httpHeadMethodLong,
HttpMethod
.Head, 4);
44
SetKnownMethod(_mask5Chars, _httpPostMethodLong,
HttpMethod
.Post, 4);
45
SetKnownMethod(_mask6Chars, _httpPatchMethodLong,
HttpMethod
.Patch, 5);
46
SetKnownMethod(_mask6Chars, _httpTraceMethodLong,
HttpMethod
.Trace, 5);
47
SetKnownMethod(_mask7Chars, _httpDeleteMethodLong,
HttpMethod
.Delete, 6);
48
SetKnownMethod(_mask8Chars, _httpConnectMethodLong,
HttpMethod
.Connect, 7);
49
SetKnownMethod(_mask8Chars, _httpOptionsMethodLong,
HttpMethod
.Options, 7);
51
_methodNames[(byte)
HttpMethod
.Connect] = HttpMethods.Connect;
52
_methodNames[(byte)
HttpMethod
.Delete] = HttpMethods.Delete;
53
_methodNames[(byte)
HttpMethod
.Get] = HttpMethods.Get;
54
_methodNames[(byte)
HttpMethod
.Head] = HttpMethods.Head;
55
_methodNames[(byte)
HttpMethod
.Options] = HttpMethods.Options;
56
_methodNames[(byte)
HttpMethod
.Patch] = HttpMethods.Patch;
57
_methodNames[(byte)
HttpMethod
.Post] = HttpMethods.Post;
58
_methodNames[(byte)
HttpMethod
.Put] = HttpMethods.Put;
59
_methodNames[(byte)
HttpMethod
.Trace] = HttpMethods.Trace;
KestrelBadHttpRequestException.cs (3)
21
internal static void Throw(RequestRejectionReason reason,
HttpMethod
method)
79
ex = new BadHttpRequestException(CoreStrings.BadRequest_MethodNotAllowed, StatusCodes.Status405MethodNotAllowed, reason,
HttpMethod
.Options);
82
ex = new BadHttpRequestException(CoreStrings.BadRequest_MethodNotAllowed, StatusCodes.Status405MethodNotAllowed, reason,
HttpMethod
.Connect);