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

# HttpConfiguration

> Extension methods for HttpConfiguration from System.Web.Http

## Definition

**Assembly:** System.Web.Http.dll

**Namespace:** System.Web.Http

## Syntax

```csharp theme={"dark"}
System.Web.Http.HttpConfiguration
```

## Summary

This type is defined in System.Web.Http.

## Remarks

See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.web.http.httpconfiguration) for more information about the rest of the API.

## Methods

### &#x20;GetTestableHttpClient Extension

> [!NOTE]
>
> Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions`

Creates a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) for a given [HttpConfiguration](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/Web/Http/HttpConfiguration.md), and returns a new [HttpClient](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/Net/Http/HttpClient.md) that uses said [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver).

#### Syntax

```csharp theme={"dark"}
public static System.Net.Http.HttpClient GetTestableHttpClient(System.Web.Http.HttpConfiguration config)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `config` | `System.Web.Http.HttpConfiguration` | The [HttpConfiguration](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/Web/Http/HttpConfiguration.md) to use with the internal [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver). |

#### Returns

Type: `System.Net.Http.HttpClient`
An [HttpClient](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/Net/Http/HttpClient.md) whose configuration is bonded to an [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) so developers don't have to manually configure all of the elements required to
successfully test the API.

### &#x20;GetTestableHttpServer Extension

> [!NOTE]
>
> Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions`

Gets a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance for a given [HttpConfiguration](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/Web/Http/HttpConfiguration.md), suitable for use in unit tests.

#### Syntax

```csharp theme={"dark"}
public static System.Web.Http.HttpServer GetTestableHttpServer(System.Web.Http.HttpConfiguration config)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `config` | `System.Web.Http.HttpConfiguration` | - |

#### Returns

Type: `System.Web.Http.HttpServer`
A new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance whose InnerHandler allows for automatic HTTP redirects.


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