# HttpCommandResultContext Properties

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

Context passed to callback to configure [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) when using [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) or [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).

## CancellationToken

- Name: `CancellationToken`
- Modifiers: `get; init`
- Returns: `CancellationToken`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The cancellation token.

```csharp
public CancellationToken CancellationToken { get; init; }
```

## Endpoint

- Name: `Endpoint`
- Modifiers: `get; init`
- Returns: [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The endpoint the request is targeting.

```csharp
public EndpointReference Endpoint { get; init; }
```

## HttpClient

- Name: `HttpClient`
- Modifiers: `get; init`
- Returns: `HttpClient`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The HTTP client that was used for the request.

```csharp
public HttpClient HttpClient { get; init; }
```

## ResourceName

- Name: `ResourceName`
- Modifiers: `get; init`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The name of the resource the command was configured on.

```csharp
public string ResourceName { get; init; }
```

## Response

- Name: `Response`
- Modifiers: `get; init`
- Returns: `HttpResponseMessage`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The HTTP response message.

```csharp
public HttpResponseMessage Response { get; init; }
```

## ServiceProvider

- Name: `ServiceProvider`
- Modifiers: `get; init`
- Returns: `IServiceProvider`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpCommandContext.cs)

The service provider.

```csharp
public IServiceProvider ServiceProvider { get; init; }
```
