22 references to HttpCommandResultMode
Aspire.Hosting (9)
ApplicationModel\HttpCommandOptions.cs (3)
70/// when <see cref="GetCommandResult"/> is not specified. The default is <see cref="HttpCommandResultMode.None"/>. 72public HttpCommandResultMode ResultMode { get; set; } 134public HttpCommandResultMode ResultMode { get; set; }
ResourceBuilderExtensions.cs (6)
3895private static bool TryGetHttpCommandResultFormat(HttpCommandResultMode resultMode, MediaTypeHeaderValue? contentType, out CommandResultFormat resultFormat) 3901case HttpCommandResultMode.None: 3903case HttpCommandResultMode.Json: 3906case HttpCommandResultMode.Text: 3909case HttpCommandResultMode.Auto: 3912throw new InvalidOperationException($"Unsupported {nameof(HttpCommandResultMode)} value '{resultMode}'.");
Aspire.Hosting.Tests (10)
WithHttpCommandTests.cs (10)
22Assert.Equal(0, (int)HttpCommandResultMode.None); 23Assert.Equal(1, (int)HttpCommandResultMode.Auto); 24Assert.Equal(2, (int)HttpCommandResultMode.Json); 25Assert.Equal(3, (int)HttpCommandResultMode.Text); 72ResultMode = HttpCommandResultMode.Json 91ResultMode = HttpCommandResultMode.Auto 835service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Json }); 862service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Text }); 890service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Auto }); 917service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode = HttpCommandResultMode.Auto });
Stress.AppHost (3)
CommandResources.cs (3)
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" });