Table of Contents

Class HttpMessageInvoker

Namespace
System.Net.Http
Assembly
System.Net.Http.dll

A specialty class that allows applications to call the Send(HttpRequestMessage)(HttpRequestMessage) method on an HTTP handler chain.

public class HttpMessageInvoker : IDisposable
Inheritance
HttpMessageInvoker
Implements
Derived
Inherited Members
Extension Methods

Constructors

HttpMessageInvoker(HttpMessageHandler)

Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

public HttpMessageInvoker(HttpMessageHandler handler)

Parameters

handler HttpMessageHandler

The HttpMessageHandler responsible for processing the HTTP response messages.

HttpMessageInvoker(HttpMessageHandler, bool)

Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

public HttpMessageInvoker(HttpMessageHandler handler, bool disposeHandler)

Parameters

handler HttpMessageHandler

The HttpMessageHandler responsible for processing the HTTP response messages.

disposeHandler bool

true if the inner handler should be disposed of by Dispose(), false if you intend to reuse the inner handler.

Exceptions

ArgumentNullException

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Send(HttpRequestMessage)

Sends an HTTP request.

public virtual HttpResponseMessage Send(HttpRequestMessage request)

Parameters

request HttpRequestMessage

The HTTP request message to send.

Returns

HttpResponseMessage

The HTTP response message.

Exceptions

ArgumentNullException

The request was null.