47 instantiations of HttpCommandOptions
Aspire.Hosting (2)
ApplicationModel\HttpCommandOptions.cs (1)
37
internal static new HttpCommandOptions Default { get; } =
new
();
ResourceBuilderExtensions.cs (1)
3802
var commandOptions = new
HttpCommandOptions
();
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
317
commandOptions:
new
()
Aspire.Hosting.Tests (21)
WithHttpCommandTests.cs (21)
55
var result = await ResourceBuilderExtensions.GetDefaultHttpCommandResultAsync(response, new
HttpCommandOptions
(), CancellationToken.None);
70
var result = await ResourceBuilderExtensions.GetDefaultHttpCommandResultAsync(response, new
HttpCommandOptions
89
var result = await ResourceBuilderExtensions.GetDefaultHttpCommandResultAsync(response, new
HttpCommandOptions
132
service.WithHttpCommand("/some-path", "Do The Thing", commandName: "mycommand", commandOptions:
new
()
228
commandOptions:
new
()
407
.WithHttpCommand("/some-path", "Do The Get Thing", commandOptions:
new
() { Method = HttpMethod.Get })
408
.WithHttpCommand("/some-path", "Do The Get Thing", endpointName: "custom-endpoint", commandOptions:
new
() { Method = HttpMethod.Get })
449
service.WithHttpCommand($"/status/{statusCode}", "Do The Thing", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient" });
475
service.WithHttpCommand("/cancel", "Cancel The Thing", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient" });
506
service.WithHttpCommand("/get-only", "Do The Thing", commandName: "mycommand", commandOptions:
new
() { Method = method, HttpClientName = "commandclient" });
533
service.WithHttpCommand("/get-only", "Do The Thing", commandName: "mycommand", commandOptions:
new
()
620
commandOptions:
new
() { HttpClientName = "commandclient" });
657
commandOptions:
new
()
701
commandOptions:
new
()
746
commandOptions:
new
()
809
service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient" });
835
service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Json });
862
service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Text });
890
service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Auto });
917
service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions:
new
() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Auto });
992
commandOptions:
new
()
Stress.AppHost (22)
CommandResources.cs (22)
903
serviceBuilder.WithHttpCommand("/write-console", "Write to console", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
904
serviceBuilder.WithHttpCommand("/increment-counter", "Increment counter", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
905
serviceBuilder.WithHttpCommand("/big-trace", "Big trace", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
906
serviceBuilder.WithHttpCommand("/log-message", "Log message", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
907
serviceBuilder.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" });
908
serviceBuilder.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" });
909
serviceBuilder.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" });
910
serviceBuilder.WithHttpCommand("/multiple-traces-linked", "Multiple traces linked", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
911
serviceBuilder.WithHttpCommand("/overflow-counter", "Overflow counter", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
912
serviceBuilder.WithHttpCommand("/nested-trace-spans", "Out of order nested spans", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
913
serviceBuilder.WithHttpCommand("/exemplars-no-span", "Examplars with no span", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
914
serviceBuilder.WithHttpCommand("/genai-trace", "Gen AI trace", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
915
serviceBuilder.WithHttpCommand("/genai-langchain-trace", "Gen AI LangChain trace", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
916
serviceBuilder.WithHttpCommand("/genai-trace-display-error", "Gen AI trace display error", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
917
serviceBuilder.WithHttpCommand("/genai-evaluations", "Gen AI evaluations", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
918
serviceBuilder.WithHttpCommand("/log-formatting", "Log formatting", commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
925
commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
930
commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
935
commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
940
commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
945
commandOptions:
new
() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning" });
950
commandOptions:
new
()
TestShop.AppHost (1)
AppHost.cs (1)
43
commandOptions:
new
()
31 references to HttpCommandOptions
Aspire.Hosting (26)
ApplicationModel\HttpCommandContext.cs (4)
8
/// <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, string?, string?,
HttpCommandOptions
?)"/>
9
/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?,
HttpCommandOptions
?)"/>.
95
/// <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, string?, string?,
HttpCommandOptions
?)"/>
96
/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?,
HttpCommandOptions
?)"/>.
ApplicationModel\HttpCommandOptions.cs (2)
33
/// Optional configuration for resource HTTP commands added with <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(Aspire.Hosting.ApplicationModel.IResourceBuilder{TResource}, string, string, string?, string?, Aspire.Hosting.ApplicationModel.
HttpCommandOptions
?)"/>.
37
internal static new
HttpCommandOptions
Default { get; } = new();
ResourceBuilderExtensions.cs (20)
3546
/// If <see cref="
HttpCommandOptions
.Method"/> is not specified, <c>POST</c> will be used.
3549
/// Specifying <see cref="
HttpCommandOptions
.HttpClientName"/> will use that named <see cref="HttpClient"/> when sending the request. This allows you to configure the <see cref="HttpClient"/>
3551
/// If <see cref="
HttpCommandOptions
.HttpClientName"/> is not specified, the default <see cref="HttpClient"/> will be used and its
3555
/// The <see cref="
HttpCommandOptions
.PrepareRequest"/> callback will be invoked to configure the request before it is sent. This can be used to add headers or a request payload
3559
/// The <see cref="
HttpCommandOptions
.GetCommandResult"/> callback will be invoked after the response is received to determine the result of the command invocation. If this callback
3561
/// <see cref="
HttpCommandOptions
.ResultMode"/> to flow the HTTP response body back to the command caller.
3601
HttpCommandOptions
? commandOptions = null)
3629
/// If no <see cref="
HttpCommandOptions
.EndpointSelector"/> is specified, the first HTTP endpoint found on the resource will be used.
3634
/// The supplied <see cref="
HttpCommandOptions
.EndpointSelector"/> may return an endpoint from a different resource to that which the command is being added to.
3640
/// If <see cref="
HttpCommandOptions
.Method"/> is not specified, <c>POST</c> will be used.
3643
/// Specifying a <see cref="
HttpCommandOptions
.HttpClientName"/> will use that named <see cref="HttpClient"/> when sending the request. This allows you to configure the <see cref="HttpClient"/>
3645
/// If <see cref="
HttpCommandOptions
.HttpClientName"/> is not specified, the default <see cref="HttpClient"/> will be used and its
3649
/// The <see cref="
HttpCommandOptions
.PrepareRequest"/> callback will be invoked to configure the request before it is sent. This can be used to add headers or a request payload
3653
/// The <see cref="
HttpCommandOptions
.GetCommandResult"/> callback will be invoked after the response is received to determine the result of the command invocation. If this callback
3655
/// <see cref="
HttpCommandOptions
.ResultMode"/> to flow the HTTP response body back to the command caller.
3678
HttpCommandOptions
? commandOptions = null)
3693
commandOptions ??=
HttpCommandOptions
.Default;
3795
private static
HttpCommandOptions
? CreateHttpCommandOptions(HttpCommandExportOptions? exportOptions)
3802
var
commandOptions = new HttpCommandOptions();
3872
internal static async Task<ExecuteCommandResult> GetDefaultHttpCommandResultAsync(HttpResponseMessage response,
HttpCommandOptions
commandOptions, CancellationToken cancellationToken)
Aspire.Hosting.RemoteHost.Tests (4)
AtsCapabilityScannerTests.cs (4)
399
Assert.DoesNotContain(dto.Properties, p => p.Name == nameof(
HttpCommandOptions
.HttpClientName));
400
Assert.DoesNotContain(dto.Properties, p => p.Name == nameof(
HttpCommandOptions
.Method));
401
Assert.DoesNotContain(dto.Properties, p => p.Name == nameof(
HttpCommandOptions
.EndpointSelector));
402
Assert.DoesNotContain(dto.Properties, p => p.Name == nameof(
HttpCommandOptions
.GetCommandResult));
Aspire.Hosting.Tests (1)
WithHttpCommandTests.cs (1)
497
var method = httpMethod is not null ? new HttpMethod(httpMethod) :
HttpCommandOptions
.Default.Method;