28 instantiations of HttpMethod
Aspire.Dashboard.Tests (1)
Aspire.Hosting (2)
Aspire.Hosting.Tests (1)
dotnet-svcutil-lib (2)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.TestHost (1)
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)
378 references to HttpMethod
aspire (8)
Aspire.Cli.EndToEnd.Tests (1)
Aspire.Dashboard.Tests (15)
Aspire.Hosting (5)
Aspire.Hosting.Azure.Sandboxes (19)
Internal\Adc\AzureDevComputeClient.cs (19)
64HttpMethod.Put,
79HttpMethod.Get,
89HttpMethod.Delete,
105HttpMethod.Put,
115HttpMethod.Post,
125HttpMethod.Post,
137HttpMethod.Post,
150HttpMethod.Delete,
170HttpMethod.Get,
185HttpMethod method,
202HttpMethod method,
222HttpMethod method,
297HttpMethod method,
374private static bool ShouldRetry(HttpMethod method, HttpStatusCode statusCode) =>
378private static bool CanRetryAfterNetworkFailure(HttpMethod method) =>
379method == HttpMethod.Get ||
380method == HttpMethod.Delete;
414HttpMethod method,
454private static async Task EnsureSuccessAsync(HttpResponseMessage response, HttpMethod method, string path, CancellationToken cancellationToken)
Aspire.Hosting.Azure.Tests (5)
Aspire.Hosting.Foundry (1)
Aspire.Hosting.GitHub.Models (1)
Aspire.Hosting.OpenAI (2)
Aspire.Hosting.Tests (5)
BlazorHosted.ClientServiceDefaults (1)
BlazorStandalone.ClientServiceDefaults (1)
dotnet-sourcelink (1)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (1)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
Microsoft.AspNetCore.Authentication.Twitter (4)
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.AspNetCore.Http.Connections.Client (15)
_generated\0\LoggerMessage.g.cs (6)
369private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.Net.Http.HttpMethod, global::System.Uri, global::System.Exception?> __SendingHttpRequestCallback =
370global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.Net.Http.HttpMethod, global::System.Uri>(global::Microsoft.Extensions.Logging.LogLevel.Trace, new global::Microsoft.Extensions.Logging.EventId(1, "SendingHttpRequest"), "Sending HTTP request {RequestMethod} '{RequestUrl}'.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true });
377public static partial void SendingHttpRequest(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Net.Http.HttpMethod requestMethod, global::System.Uri requestUrl)
385private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.Net.HttpStatusCode, global::System.Net.Http.HttpMethod, global::System.Uri, global::System.Exception?> __UnsuccessfulHttpResponseCallback =
386global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.Net.HttpStatusCode, global::System.Net.Http.HttpMethod, global::System.Uri>(global::Microsoft.Extensions.Logging.LogLevel.Warning, new global::Microsoft.Extensions.Logging.EventId(2, "UnsuccessfulHttpResponse"), "Unsuccessful HTTP response {StatusCode} return from {RequestMethod} '{RequestUrl}'.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true });
393public static partial void UnsuccessfulHttpResponse(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Net.HttpStatusCode statusCode, global::System.Net.Http.HttpMethod requestMethod, global::System.Uri requestUrl)
Microsoft.AspNetCore.Mvc.Testing (4)
Microsoft.AspNetCore.OpenApi (14)
Extensions\ApiDescriptionExtensions.cs (12)
20/// The <see cref="HttpMethod"/> associated with the given <paramref name="apiDescription"/>, including custom methods
23public static HttpMethod? GetHttpMethod(this ApiDescription apiDescription)
35"GET" => HttpMethod.Get,
36"POST" => HttpMethod.Post,
37"PUT" => HttpMethod.Put,
38"DELETE" => HttpMethod.Delete,
39"PATCH" => HttpMethod.Patch,
40"HEAD" => HttpMethod.Head,
41"OPTIONS" => HttpMethod.Options,
42"TRACE" => HttpMethod.Trace,
43"QUERY" => HttpMethod.Query,
47static HttpMethod? TryCreateHttpMethod(string httpMethod)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.TestHost (3)
Microsoft.Deployment.DotNet.Releases (1)
Microsoft.DotNet.Cli.Telemetry (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 (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Logging.g.cs (4)
13public static partial void RequestReadError(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception exception, global::System.Net.Http.HttpMethod method, string? host, string? path)
52public static partial void ResponseReadError(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception exception, global::System.Net.Http.HttpMethod method, string host, string path)
91public static partial void LoggerContextMissing(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception? exception, string requestState, global::System.Net.Http.HttpMethod method, string? host)
130public static partial void EnrichmentError(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception exception, string? enricher, global::System.Net.Http.HttpMethod method, string host, string path)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (69)
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 (24)
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,
616Method = HttpMethod.Post,
663Method = HttpMethod.Get,
695using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
725using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
761using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
809using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
850using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
898httpRequestMessage.Method = HttpMethod.Get;
Microsoft.Extensions.Http.Resilience (8)
Microsoft.Extensions.Http.Resilience.PerformanceTests (4)
Microsoft.Extensions.Http.Resilience.Tests (28)
Microsoft.Extensions.Logging.AzureAppServices (2)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.NET.Build.Containers (7)
Microsoft.NET.Sdk.Publish.Tasks (2)
netstandard (1)
NuGet.Protocol (13)
Stress.AppHost (22)
CommandResources.cs (22)
903serviceBuilder.WithHttpCommand("/write-console", "Write to console", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
904serviceBuilder.WithHttpCommand("/increment-counter", "Increment counter", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
905serviceBuilder.WithHttpCommand("/big-trace", "Big trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
906serviceBuilder.WithHttpCommand("/log-message", "Log message", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
907serviceBuilder.WithHttpCommand("/http-command-auto-result", "HTTP command auto result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode = HttpCommandResultMode.Auto, Description = "Run an HTTP command and infer the result format from the response content type" });
908serviceBuilder.WithHttpCommand("/http-command-json-result", "HTTP command JSON result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode = HttpCommandResultMode.Json, Description = "Run an HTTP command and flow the JSON response back to the caller" });
909serviceBuilder.WithHttpCommand("/http-command-text-result", "HTTP command text result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode = HttpCommandResultMode.Text, Description = "Run an HTTP command and flow the plain-text response back to the caller" });
910serviceBuilder.WithHttpCommand("/multiple-traces-linked", "Multiple traces linked", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
911serviceBuilder.WithHttpCommand("/overflow-counter", "Overflow counter", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
912serviceBuilder.WithHttpCommand("/nested-trace-spans", "Out of order nested spans", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
913serviceBuilder.WithHttpCommand("/exemplars-no-span", "Examplars with no span", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
914serviceBuilder.WithHttpCommand("/genai-trace", "Gen AI trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
915serviceBuilder.WithHttpCommand("/genai-langchain-trace", "Gen AI LangChain trace", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
916serviceBuilder.WithHttpCommand("/genai-trace-display-error", "Gen AI trace display error", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
917serviceBuilder.WithHttpCommand("/genai-evaluations", "Gen AI evaluations", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
918serviceBuilder.WithHttpCommand("/log-formatting", "Log formatting", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
925commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
930commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
935commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
940commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
945commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
952Method = HttpMethod.Post,
System.Net.Http (52)
System\Net\Http\HttpClient.cs (9)
175HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
249HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
326HttpRequestMessage request = CreateRequestMessage(HttpMethod.Get, requestUri);
387SendAsync(CreateRequestMessage(HttpMethod.Get, requestUri), completionOption, cancellationToken);
400HttpRequestMessage request = CreateRequestMessage(HttpMethod.Post, requestUri);
416HttpRequestMessage request = CreateRequestMessage(HttpMethod.Put, requestUri);
432HttpRequestMessage request = CreateRequestMessage(HttpMethod.Patch, requestUri);
447SendAsync(CreateRequestMessage(HttpMethod.Delete, requestUri), cancellationToken);
834private 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)