Class HttpMessageInvoker
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
HttpMessageHandlerThe 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
HttpMessageHandlerThe HttpMessageHandler responsible for processing the HTTP response messages.
disposeHandler
booltrue if the inner handler should be disposed of by Dispose(), false if you intend to reuse the inner handler.
Exceptions
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
HttpRequestMessageThe HTTP request message to send.
Returns
- HttpResponseMessage
The HTTP response message.
Exceptions
- ArgumentNullException
The
request
was null.