# HttpCommandOptions Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [HttpCommandOptions](/reference/api/csharp/aspire.hosting/httpcommandoptions.md)
- Kind: `Properties`
- Members: `6`

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).

## EndpointSelector

- Name: `EndpointSelector`
- Modifiers: `nullable` `get; set`
- Returns: `Func<EndpointReference>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

Gets or sets a callback that selects the HTTP endpoint to send the request to when the command is invoked.

```csharp
public Func<EndpointReference>? EndpointSelector { get; set; }
```

## GetCommandResult

- Name: `GetCommandResult`
- Modifiers: `nullable` `get; set`
- Returns: `Func<HttpCommandResultContext, Task<ExecuteCommandResult>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

Gets or sets a callback to be invoked after the response is received to determine the result of the command invocation.

```csharp
public Func<HttpCommandResultContext, Task<ExecuteCommandResult>>? GetCommandResult { get; set; }
```

## HttpClientName

- Name: `HttpClientName`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

Gets or sets the name of the HTTP client to use when creating it via `IHttpClientFactory.CreateClient`.

```csharp
public string? HttpClientName { get; set; }
```

## Method

- Name: `Method`
- Modifiers: `nullable` `get; set`
- Returns: `HttpMethod?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

Gets or sets the HTTP method to use when sending the request.

```csharp
public HttpMethod? Method { get; set; }
```

## PrepareRequest

- Name: `PrepareRequest`
- Modifiers: `nullable` `get; set`
- Returns: `Func<HttpCommandRequestContext, Task>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

Gets or sets a callback to be invoked to configure the request before it is sent.

```csharp
public Func<HttpCommandRequestContext, Task>? PrepareRequest { get; set; }
```

## ResultMode

- Name: `ResultMode`
- Modifiers: `get; set`
- Returns: [HttpCommandResultMode](/reference/api/csharp/aspire.hosting/httpcommandresultmode.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandOptions.cs)

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).

```csharp
public HttpCommandResultMode ResultMode { get; set; }
```
