87 references to HttpMethod
Microsoft.AspNetCore.Server.Kestrel.Core (87)
BadHttpRequestException.cs (1)
20internal BadHttpRequestException(string message, int statusCode, RequestRejectionReason reason, HttpMethod? requiredMethod)
Internal\Http\Http1Connection.cs (6)
402var method = versionAndMethod.Method; 428if (method == HttpMethod.Custom) 555private void OnAuthorityFormTarget(HttpMethod method, Span<byte> target) 568if (method != HttpMethod.Connect) 606private void OnAsteriskFormTarget(HttpMethod method) 612if (method != HttpMethod.Options)
Internal\Http\Http1MessageBody.cs (2)
224if (httpVersion == HttpVersion.Http10 && (context.Method == HttpMethod.Post || context.Method == HttpMethod.Put))
Internal\Http\HttpParser.cs (2)
411var method = requestLine.GetKnownMethod(out var methodEnd); 412if (method == HttpMethod.Custom)
Internal\Http\HttpProtocol.cs (9)
148public HttpMethod Method { get; set; } 378Method = HttpMethod.None; 936if (Method != HttpMethod.Head && 1115if (Method == HttpMethod.Head && _responseBytesWritten > 0) 1136if (Method == HttpMethod.Head && _responseBytesWritten > 0) 1298else if (Method == HttpMethod.Connect && Is2xxCode(StatusCode)) 1314return Method != HttpMethod.Head && 1324Method != HttpMethod.Head && 1396if (Method != HttpMethod.Head)
Internal\Http\IHttpRequestLineHandler.cs (3)
36public HttpVersionAndMethod(HttpMethod method, int methodEnd) 55public HttpMethod Method => (HttpMethod)(byte)(_versionAndMethod >> 8);
Internal\Http2\Http2Stream.cs (7)
249if (Method == HttpMethod.None && !TryValidateMethod()) 259if (Method == HttpMethod.Connect) 323if (Method == HttpMethod.Options && path.Length == 1 && path[0] == '*') 353if (Method == HttpMethod.None) 359if (Method == HttpMethod.Custom) 700Method = HttpMethod.Get; 705Method = HttpMethod.Post;
Internal\Http3\Http3Stream.cs (7)
22using HttpMethod = Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpMethod; 267Method = HttpMethod.Get; 272Method = HttpMethod.Post; 1058if (Method == HttpMethod.Connect && HttpRequestHeaders.HeaderProtocol.Count == 0) 1101if (Method == HttpMethod.Options && path.Length == 1 && path[0] == '*') 1131if (Method == HttpMethod.None) 1137if (Method == HttpMethod.Custom)
Internal\Infrastructure\HttpUtilities.cs (28)
33private 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); 42var invalidHttpMethod = new Tuple<ulong, ulong, HttpMethod, int>(_mask8Chars, 0ul, HttpMethod.Custom, 0); 207public static bool GetKnownMethod(this ReadOnlySpan<byte> span, out HttpMethod method, out int length) 210return method != HttpMethod.Custom; 214public static HttpMethod GetKnownMethod(this ReadOnlySpan<byte> span, out int methodLength) 222return HttpMethod.Get; 242return HttpMethod.Custom; 252/// <returns><see cref="HttpMethod"/></returns> 253public static HttpMethod GetKnownMethod(string? value) 274return HttpMethod.None; 293return HttpMethod.Custom; 335static ReadOnlySpan<HttpMethod> Methods() => 337HttpMethod.None, 338HttpMethod.None, 339HttpMethod.None, 340HttpMethod.Get, 341HttpMethod.Head, 342HttpMethod.Trace, 343HttpMethod.Delete, 344HttpMethod.Options, 345HttpMethod.Put, 346HttpMethod.Post, 347HttpMethod.Patch, 348HttpMethod.None, 349HttpMethod.Connect 470public static string? MethodToString(HttpMethod method)
Internal\Infrastructure\HttpUtilities.Generated.cs (19)
35private static readonly Tuple<ulong, ulong, HttpMethod, int>[] _knownMethods = 36new Tuple<ulong, ulong, HttpMethod, int>[17]; 42SetKnownMethod(_mask4Chars, _httpPutMethodLong, HttpMethod.Put, 3); 43SetKnownMethod(_mask5Chars, _httpHeadMethodLong, HttpMethod.Head, 4); 44SetKnownMethod(_mask5Chars, _httpPostMethodLong, HttpMethod.Post, 4); 45SetKnownMethod(_mask6Chars, _httpPatchMethodLong, HttpMethod.Patch, 5); 46SetKnownMethod(_mask6Chars, _httpTraceMethodLong, HttpMethod.Trace, 5); 47SetKnownMethod(_mask7Chars, _httpDeleteMethodLong, HttpMethod.Delete, 6); 48SetKnownMethod(_mask8Chars, _httpConnectMethodLong, HttpMethod.Connect, 7); 49SetKnownMethod(_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)
21internal static void Throw(RequestRejectionReason reason, HttpMethod method) 79ex = new BadHttpRequestException(CoreStrings.BadRequest_MethodNotAllowed, StatusCodes.Status405MethodNotAllowed, reason, HttpMethod.Options); 82ex = new BadHttpRequestException(CoreStrings.BadRequest_MethodNotAllowed, StatusCodes.Status405MethodNotAllowed, reason, HttpMethod.Connect);