> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# ResponseSnapshotHandlerBase

> Base class for Response Snapshot handlers that enable testing with real captured HTTP responses.

## Definition

**Assembly:** CloudNimble.Breakdance.Assemblies.dll

**Namespace:** CloudNimble.Breakdance.Assemblies.Http

**Inheritance:** System.Net.Http.DelegatingHandler

## Syntax

```csharp theme={"dark"}
CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase
```

## Summary

Base class for Response Snapshot handlers that enable testing with real captured HTTP responses.

## Remarks

Response Snapshots are real HTTP responses captured from actual API calls and stored as files.
This allows testing against real response data without hitting live endpoints or polluting
third-party services with test data.

Use [ResponseSnapshotCaptureHandler](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler.md) to capture responses from live APIs,
then use [ResponseSnapshotReplayHandler](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler.md) to replay those responses in tests.

## Constructors

### &#x20;.ctor

Creates a new [ResponseSnapshotHandlerBase](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase.md) with the specified snapshot storage path.

#### Syntax

```csharp theme={"dark"}
public ResponseSnapshotHandlerBase(string responseSnapshotsPath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. |

#### Examples

```csharp theme={"dark"}
var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots");
var client = new HttpClient(handler);
```

## Properties

### &#x20;ResponseSnapshotsPath

Gets the root folder path where response snapshot files are stored.

#### Syntax

```csharp theme={"dark"}
public string ResponseSnapshotsPath { get; private set; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;GetFileExtensionString

Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions.

#### Syntax

```csharp theme={"dark"}
public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. |

#### Returns

Type: `string`
The file extension string for the request's Accept header.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when request is null. |

### &#x20;GetResponseMediaTypeString

Maps the file extension in the specified path to a known list of media types.

#### Syntax

```csharp theme={"dark"}
public static string GetResponseMediaTypeString(string filePath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `filePath` | `string` | The file path to examine. |

#### Returns

Type: `string`
The MIME type string for the file extension.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.