23 instantiations of HttpMethod
Aspire.Dashboard.Tests (1)
Aspire.Hosting.Tests (1)
dotnet-svcutil-lib (2)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Http.Resilience.Tests (2)
System.Net.Http (12)
System\Net\Http\HttpMethod.cs (12)
14public static HttpMethod Get { get; } = new("GET", H3StaticTable.MethodGet);
15public static HttpMethod Put { get; } = new("PUT", H3StaticTable.MethodPut);
16public static HttpMethod Post { get; } = new("POST", H3StaticTable.MethodPost);
17public static HttpMethod Delete { get; } = new("DELETE", H3StaticTable.MethodDelete);
18public static HttpMethod Head { get; } = new("HEAD", H3StaticTable.MethodHead);
19public static HttpMethod Options { get; } = new("OPTIONS", H3StaticTable.MethodOptions);
20public static HttpMethod Trace { get; } = new("TRACE", http3StaticTableIndex: -1);
21public static HttpMethod Patch { get; } = new("PATCH", http3StaticTableIndex: -1);
25public static HttpMethod Query { get; } = new("QUERY", http3StaticTableIndex: -1);
29public static HttpMethod Connect { get; } = new("CONNECT", H3StaticTable.MethodConnect);
90/// same validation being performed as by the <see cref="HttpMethod(string)"/> constructor.
94new HttpMethod(method.ToString());
System.ServiceModel.Http (1)
287 references to HttpMethod
aspire (2)
Aspire.Dashboard (1)
Aspire.Dashboard.Tests (18)
Aspire.Hosting (5)
Aspire.Hosting.Foundry (1)
Aspire.Hosting.GitHub.Models (1)
Aspire.Hosting.OpenAI (2)
Aspire.Hosting.Tests (3)
dotnet-sourcelink (1)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (16)
Logging\AcceptanceTests.cs (11)
236Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
296Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
349Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
378using var request = new HttpRequestMessage(HttpMethod.Post, "/")
409Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
442using var httpMessage = new HttpRequestMessage(HttpMethod.Get, "/");
470Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
509Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Delete.ToString());
668Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
709Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
743Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
Microsoft.Deployment.DotNet.Releases (1)
Microsoft.Extensions.AI.Evaluation.Safety (3)
Microsoft.Extensions.AI.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI.Tests (2)
Microsoft.Extensions.Http (6)
Logging\LogHelper.cs (6)
35private static readonly Action<ILogger, HttpMethod, string?, Exception?> _requestStart = LoggerMessage.Define<HttpMethod, string?>(
51private static readonly Func<ILogger, HttpMethod, string?, IDisposable?> _beginRequestPipelineScope = LoggerMessage.DefineScope<HttpMethod, string?>("HTTP {HttpMethod} {Uri}");
53private static readonly Action<ILogger, HttpMethod, string?, Exception?> _requestPipelineStart = LoggerMessage.Define<HttpMethod, string?>(
Microsoft.Extensions.Http.Diagnostics (6)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (67)
Logging\AcceptanceTests.cs (15)
47Assert.Equal($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", logRecord.Message);
80Assert.EndsWith($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", firstLogRecord.Message);
88Assert.Equal($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", secondLogRecord.Message);
109Method = HttpMethod.Get,
164Method = HttpMethod.Get,
180Method = HttpMethod.Get,
245Method = HttpMethod.Get,
267Method = HttpMethod.Get,
310Method = HttpMethod.Get,
357Method = HttpMethod.Get,
422Method = HttpMethod.Get,
591using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, _unreachableRequestUri);
617using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, _unreachableRequestUri);
640using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, _unreachableRequestUri);
683Method = HttpMethod.Get,
Logging\HttpClientLoggerTest.cs (19)
85Method = HttpMethod.Get,
123Method = HttpMethod.Get,
173Method = HttpMethod.Post,
185Method = HttpMethod.Post,
270Method = HttpMethod.Post,
282Method = HttpMethod.Post,
377Method = HttpMethod.Post,
389Method = HttpMethod.Post,
474Method = HttpMethod.Post,
486Method = HttpMethod.Post,
590Method = HttpMethod.Post,
602Method = HttpMethod.Post,
695Method = HttpMethod.Post,
738Method = HttpMethod.Post,
776Method = HttpMethod.Post,
820Method = HttpMethod.Post,
854Method = HttpMethod.Post,
870Method = HttpMethod.Post,
967Method = HttpMethod.Post,
Logging\HttpRequestReaderTest.cs (23)
51Method = HttpMethod.Post,
85Method = HttpMethod.Post,
121Method = HttpMethod.Post,
150Method = HttpMethod.Post,
181Method = HttpMethod.Post,
215Method = HttpMethod.Post,
254Method = HttpMethod.Post,
291Method = HttpMethod.Post,
332Method = HttpMethod.Post,
364Method = HttpMethod.Post,
390Method = HttpMethod.Post,
424Method = HttpMethod.Post,
463Method = HttpMethod.Post,
497Method = HttpMethod.Post,
532Method = HttpMethod.Post,
566Method = HttpMethod.Post,
628Method = HttpMethod.Get,
660using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
690using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
726using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
774using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
815using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
863httpRequestMessage.Method = HttpMethod.Get;
Microsoft.Extensions.Http.Resilience (8)
Microsoft.Extensions.Http.Resilience.PerformanceTests (4)
Microsoft.Extensions.Http.Resilience.Tests (28)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.NET.Build.Containers (6)
Microsoft.NET.Sdk.Publish.Tasks (2)
netstandard (1)
NuGet.Protocol (13)
Stress.AppHost (18)
Program.cs (18)
78serviceBuilder.WithHttpCommand("/write-console", "Write to console", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
79serviceBuilder.WithHttpCommand("/write-console-large", "Write to console large", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
80serviceBuilder.WithHttpCommand("/increment-counter", "Increment counter", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
81serviceBuilder.WithHttpCommand("/big-trace", "Big trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
82serviceBuilder.WithHttpCommand("/trace-limit", "Trace limit", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
83serviceBuilder.WithHttpCommand("/log-message", "Log message", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
84serviceBuilder.WithHttpCommand("/log-message-limit", "Log message limit", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
85serviceBuilder.WithHttpCommand("/log-message-limit-large", "Log message limit large", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
86serviceBuilder.WithHttpCommand("/multiple-traces-linked", "Multiple traces linked", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
87serviceBuilder.WithHttpCommand("/overflow-counter", "Overflow counter", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
88serviceBuilder.WithHttpCommand("/nested-trace-spans", "Out of order nested spans", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
89serviceBuilder.WithHttpCommand("/exemplars-no-span", "Examplars with no span", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
90serviceBuilder.WithHttpCommand("/genai-trace", "Gen AI trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
91serviceBuilder.WithHttpCommand("/genai-langchain-trace", "Gen AI LangChain trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
92serviceBuilder.WithHttpCommand("/genai-trace-display-error", "Gen AI trace display error", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
93serviceBuilder.WithHttpCommand("/genai-evaluations", "Gen AI evaluations", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
94serviceBuilder.WithHttpCommand("/log-formatting", "Log formatting", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
95serviceBuilder.WithHttpCommand("/big-nested-trace", "Big nested trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
System.Net.Http (52)
System\Net\Http\HttpClient.cs (9)
170HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
242HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
317HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
378SendAsync(CreateRequestMessage(HttpMethod.Get, requestUri), completionOption, cancellationToken);
391HttpRequestMessage request = CreateRequestMessage(HttpMethod.Post, requestUri);
407HttpRequestMessage request = CreateRequestMessage(HttpMethod.Put, requestUri);
423HttpRequestMessage request = CreateRequestMessage(HttpMethod.Patch, requestUri);
438SendAsync(CreateRequestMessage(HttpMethod.Delete, requestUri), cancellationToken);
825private HttpRequestMessage CreateRequestMessage(HttpMethod method, Uri? uri) =>
System\Net\Http\HttpMethod.cs (23)
9public partial class HttpMethod : IEquatable<HttpMethod>
14public static HttpMethod Get { get; } = new("GET", H3StaticTable.MethodGet);
15public static HttpMethod Put { get; } = new("PUT", H3StaticTable.MethodPut);
16public static HttpMethod Post { get; } = new("POST", H3StaticTable.MethodPost);
17public static HttpMethod Delete { get; } = new("DELETE", H3StaticTable.MethodDelete);
18public static HttpMethod Head { get; } = new("HEAD", H3StaticTable.MethodHead);
19public static HttpMethod Options { get; } = new("OPTIONS", H3StaticTable.MethodOptions);
20public static HttpMethod Trace { get; } = new("TRACE", http3StaticTableIndex: -1);
21public static HttpMethod Patch { get; } = new("PATCH", http3StaticTableIndex: -1);
25public static HttpMethod Query { get; } = new("QUERY", http3StaticTableIndex: -1);
29public static HttpMethod Connect { get; } = new("CONNECT", H3StaticTable.MethodConnect);
55public bool Equals([NotNullWhen(true)] HttpMethod? other) =>
60obj is HttpMethod method &&
75public static bool operator ==(HttpMethod? left, HttpMethod? right) =>
80public static bool operator !=(HttpMethod? left, HttpMethod? right) =>
83/// <summary>Parses the provided <paramref name="method"/> into an <see cref="HttpMethod"/> instance.</summary>
85/// <returns>An <see cref="HttpMethod"/> instance for the provided <paramref name="method"/>.</returns>
89/// if "get" is specified. For unknown methods, a new <see cref="HttpMethod"/> instance is returned, with the
92public static HttpMethod Parse(ReadOnlySpan<char> method) =>
96internal static HttpMethod? GetKnownMethod(ReadOnlySpan<char> method)
100HttpMethod? match = (method[0] | 0x20) switch
System.Net.Http.WinHttpHandler (1)
System.Net.Requests (4)
System.ServiceModel.Http (2)