# HttpCommandResultContext

- 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/HttpCommandContext.cs)

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

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class HttpCommandResultContext
{
    // ...
}
```

## Constructors

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

## Properties

- [CancellationToken](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#cancellationtoken) : `CancellationToken` `get; init` -- The cancellation token.
- [Endpoint](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#endpoint) : [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) `get; init` -- The endpoint the request is targeting.
- [HttpClient](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#httpclient) : `HttpClient` `get; init` -- The HTTP client that was used for the request.
- [ResourceName](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#resourcename) : `string` `get; init` -- The name of the resource the command was configured on.
- [Response](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#response) : `HttpResponseMessage` `get; init` -- The HTTP response message.
- [ServiceProvider](/reference/api/csharp/aspire.hosting/httpcommandresultcontext/properties.md#serviceprovider) : `IServiceProvider` `get; init` -- The service provider.
