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
handlerHttpMessageHandlerThe 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
handlerHttpMessageHandlerThe HttpMessageHandler responsible for processing the HTTP response messages.
disposeHandlerbooltrue 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
disposingbool
Send(HttpRequestMessage)
Sends an HTTP request.
public virtual HttpResponseMessage Send(HttpRequestMessage request)
Parameters
requestHttpRequestMessageThe HTTP request message to send.
Returns
- HttpResponseMessage
The HTTP response message.
Exceptions
- ArgumentNullException
The
requestwas null.