Skip to main content

Definition

Assembly: System.Web.Http.dll Namespace: System.Web.Http

Syntax

System.Web.Http.HttpConfiguration

Summary

This type is defined in System.Web.Http.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

GetTestableHttpClient Extension

Extension method from System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions
Creates a new HttpServer for a given HttpConfiguration, and returns a new HttpClient that uses said HttpServer.

Syntax

public static System.Net.Http.HttpClient GetTestableHttpClient(System.Web.Http.HttpConfiguration config)

Parameters

NameTypeDescription
configSystem.Web.Http.HttpConfigurationThe HttpConfiguration to use with the internal HttpServer.

Returns

Type: System.Net.Http.HttpClient An HttpClient whose configuration is bonded to an HttpServer so developers don’t have to manually configure all of the elements required to successfully test the API.

GetTestableHttpServer Extension

Extension method from System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions
Gets a new HttpServer instance for a given HttpConfiguration, suitable for use in unit tests.

Syntax

public static System.Web.Http.HttpServer GetTestableHttpServer(System.Web.Http.HttpConfiguration config)

Parameters

NameTypeDescription
configSystem.Web.Http.HttpConfiguration-

Returns

Type: System.Web.Http.HttpServer A new HttpServer instance whose InnerHandler allows for automatic HTTP redirects.