87 references to HttpMethod
Microsoft.AspNetCore.Server.Kestrel.Core (87)
BadHttpRequestException.cs (1)
20
internal BadHttpRequestException(string message, int statusCode, RequestRejectionReason reason,
HttpMethod
? requiredMethod)
Internal\Http\Http1Connection.cs (6)
402
var
method = versionAndMethod.Method;
428
if (method ==
HttpMethod
.Custom)
555
private void OnAuthorityFormTarget(
HttpMethod
method, Span<byte> target)
568
if (method !=
HttpMethod
.Connect)
606
private void OnAsteriskFormTarget(
HttpMethod
method)
612
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)
411
var
method = requestLine.GetKnownMethod(out var methodEnd);
412
if (method ==
HttpMethod
.Custom)
Internal\Http\HttpProtocol.cs (9)
148
public
HttpMethod
Method { get; set; }
378
Method =
HttpMethod
.None;
936
if (Method !=
HttpMethod
.Head &&
1115
if (Method ==
HttpMethod
.Head && _responseBytesWritten > 0)
1136
if (Method ==
HttpMethod
.Head && _responseBytesWritten > 0)
1298
else if (Method ==
HttpMethod
.Connect && Is2xxCode(StatusCode))
1314
return Method !=
HttpMethod
.Head &&
1324
Method !=
HttpMethod
.Head &&
1396
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] == '*')
353
if (Method ==
HttpMethod
.None)
359
if (Method ==
HttpMethod
.Custom)
700
Method =
HttpMethod
.Get;
705
Method =
HttpMethod
.Post;
Internal\Http3\Http3Stream.cs (7)
22
using HttpMethod = Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.
HttpMethod
;
267
Method =
HttpMethod
.Get;
272
Method =
HttpMethod
.Post;
1058
if (Method ==
HttpMethod
.Connect && HttpRequestHeaders.HeaderProtocol.Count == 0)
1101
if (Method ==
HttpMethod
.Options && path.Length == 1 && path[0] == '*')
1131
if (Method ==
HttpMethod
.None)
1137
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);