HttpClient HttpClient HttpClient HttpClient HttpClient Constructors

Definition

Overloads

HttpClient() HttpClient() HttpClient() HttpClient() HttpClient()

Initializes a new instance of the HttpClient class.

HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter)

Initializes a new instance of the HttpClient class with a specific filter for handling HTTP response messages.

HttpClient() HttpClient() HttpClient() HttpClient() HttpClient()

Initializes a new instance of the HttpClient class.

public : HttpClient()
HttpClient() const;
public HttpClient()
Public Sub New()
var httpClient = new httpClient();
See Also

HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter) HttpClient(IHttpFilter)

Initializes a new instance of the HttpClient class with a specific filter for handling HTTP response messages.

public : HttpClient(IHttpFilter filter)
HttpClient(IHttpFilter filter) const;
public HttpClient(IHttpFilter filter)
Public Sub New(filter As IHttpFilter)
var httpClient = new httpClient(filter);
Parameters
filter
IHttpFilter IHttpFilter IHttpFilter

The HTTP filter to use for handling response messages.

Examples

The sample code shows creating an HttpClient to use a custom filter.


internal static void CreateHttpClient(ref HttpClient httpClient)
{
    if (httpClient != null) {
        httpClient.Dispose();
    }

    // HttpClient can be extended by plugging multiple filters together,
    // providing HttpClient with the configured filter pipeline.
    var baseFilter = new HttpBaseProtocolFilter();

    var myFilter = new MyCustomFilter(baseFilter);
    httpClient = new HttpClient(myFilter);
}

Remarks

If a null reference (Nothing in Visual Basic) is specified for the filter parameter, the default transport handler for receiving responses with no filter is used.

See Also