Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Normalize()

static HttpMethod System.Net.Http.HttpMethod.Normalize ( HttpMethod method)
inlinestaticpackage

Definition at line 165 of file HttpMethod.cs.

166 {
167 int? http3Index = method._http3Index;
168 if (!http3Index.HasValue && method._method.Length >= 3)
169 {
170 HttpMethod httpMethod = (method._method[0] | 0x20) switch
171 {
172 99 => s_connectMethod,
173 100 => s_deleteMethod,
174 103 => s_getMethod,
175 104 => s_headMethod,
176 111 => s_optionsMethod,
177 112 => method._method.Length switch
178 {
179 3 => s_putMethod,
180 4 => s_postMethod,
181 _ => s_patchMethod,
182 },
183 116 => s_traceMethod,
184 _ => null,
185 };
186 if ((object)httpMethod != null && string.Equals(method._method, httpMethod._method, StringComparison.OrdinalIgnoreCase))
187 {
188 return httpMethod;
189 }
190 }
191 return method;
192 }
HttpMethod(string method)
static readonly HttpMethod s_patchMethod
Definition HttpMethod.cs:29
static readonly HttpMethod s_optionsMethod
Definition HttpMethod.cs:25
static readonly HttpMethod s_postMethod
Definition HttpMethod.cs:19
static readonly HttpMethod s_traceMethod
Definition HttpMethod.cs:27
static readonly HttpMethod s_connectMethod
Definition HttpMethod.cs:31
static readonly HttpMethod s_headMethod
Definition HttpMethod.cs:23
static readonly HttpMethod s_deleteMethod
Definition HttpMethod.cs:21
static readonly HttpMethod s_getMethod
Definition HttpMethod.cs:15
static readonly HttpMethod s_putMethod
Definition HttpMethod.cs:17

References System.Net.Http.HttpMethod._http3Index, System.Net.Http.HttpMethod._method, System.Net.Http.HttpMethod.Equals(), System.Net.Http.HttpMethod.s_connectMethod, System.Net.Http.HttpMethod.s_deleteMethod, System.Net.Http.HttpMethod.s_getMethod, System.Net.Http.HttpMethod.s_headMethod, System.Net.Http.HttpMethod.s_optionsMethod, System.Net.Http.HttpMethod.s_patchMethod, System.Net.Http.HttpMethod.s_postMethod, System.Net.Http.HttpMethod.s_putMethod, and System.Net.Http.HttpMethod.s_traceMethod.

Referenced by System.Net.Http.Http3RequestStream.BufferHeaders(), System.Net.Http.HttpConnection.SendAsyncCore(), and System.Net.Http.Http2Connection.WriteHeaders().