> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/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

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetTestableHttpClient <Badge color="green">Extension</Badge>

<Note>Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions`</Note>

Creates a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) for a given [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration), and returns a new [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) 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](/breakdance/api-reference/System/Web/Http/HttpConfiguration) to use with the internal [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver). |

#### Returns

Type: `System.Net.Http.HttpClient`
An [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) 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.

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetTestableHttpServer <Badge color="green">Extension</Badge>

<Note>Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions`</Note>

Gets a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance for a given [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration), 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.
