# HttpCommandOptions

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)
- Inherits: [CommandOptions](/reference/api/csharp/aspire.hosting/commandoptions.md)

Optional configuration for resource HTTP commands added with [ResourceBuilderExtensions.WithHttpCommand(IResourceBuilder<TResource>, string, string, string?, string?, HttpCommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpcommand-iresourcebuilder-tresource-string-string-string-string-httpcommandoptions).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class HttpCommandOptions
    : Aspire.Hosting.ApplicationModel.CommandOptions
{
    // ...
}
```

## Constructors

- [HttpCommandOptions](/reference/api/csharp/aspire.hosting/httpcommandoptions/constructors.md#constructor)

## Properties

- [EndpointSelector](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#endpointselector) : `Func<EndpointReference>` `get; set` -- Gets or sets a callback that selects the HTTP endpoint to send the request to when the command is invoked.
- [GetCommandResult](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#getcommandresult) : `Func<HttpCommandResultContext, Task<ExecuteCommandResult>>` `get; set` -- Gets or sets a callback to be invoked after the response is received to determine the result of the command invocation.
- [HttpClientName](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#httpclientname) : `string?` `get; set` -- Gets or sets the name of the HTTP client to use when creating it via `IHttpClientFactory.CreateClient`.
- [Method](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#method) : `HttpMethod?` `get; set` -- Gets or sets the HTTP method to use when sending the request.
- [PrepareRequest](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#preparerequest) : `Func<HttpCommandRequestContext, Task>` `get; set` -- Gets or sets a callback to be invoked to configure the request before it is sent.
- [ResultMode](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#resultmode) : [HttpCommandResultMode](/reference/api/csharp/aspire.hosting/httpcommandresultmode.md) `get; set` -- Gets or sets how the HTTP response content should be returned as command result data when [HttpCommandOptions.GetCommandResult](/reference/api/csharp/aspire.hosting/httpcommandoptions/properties.md#getcommandresult) is not specified. The default is [HttpCommandResultMode.None](/reference/api/csharp/aspire.hosting/httpcommandresultmode/fields.md).
