Table of Contents

Class HttpManagerOptions

Namespace
Cuemon.Net.Http
Assembly
Cuemon.Net.dll

Specifies options that is related to the HttpManager class.

public class HttpManagerOptions : IValidatableParameterObject, IParameterObject
Inheritance
Object
HttpManagerOptions
Implements

Constructors

HttpManagerOptions()

Initializes a new instance of the HttpManagerOptions class.

public HttpManagerOptions()

Remarks

The following table shows the initial property values for an instance of HttpManagerOptions.

PropertyInitial Value
DisposeHandlerfalse
DefaultRequestHeadersConnection: Keep-Alive
HandlerFactorySystem.Net.Http.HttpClientHandler initialized with System.Net.Http.HttpClientHandler.AutomaticDecompression for GZip|Deflate and System.Net.Http.HttpClientHandler.MaxAutomaticRedirections to 10.
Timeout2 minutes

Properties

DefaultRequestHeaders

Gets or sets the default headers which should be sent with each request.

public Dictionary<string, string> DefaultRequestHeaders { get; set; }

Property Value

Dictionary<String, String>

The default headers which should be sent with each request.

DisposeHandler

Gets or sets a value indicating whether the inner handler should be disposed of by Dispose().

public bool DisposeHandler { get; set; }

Property Value

Boolean

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

HandlerFactory

Gets or sets the HTTP handler stack to use for sending requests.

public Func<HttpMessageHandler> HandlerFactory { get; set; }

Property Value

Func<HttpMessageHandler>

The HTTP handler stack to use for sending requests.

Timeout

Gets or sets the timespan to wait before the request times out. Default is 2 minutes.

public TimeSpan Timeout { get; set; }

Property Value

TimeSpan

The timespan to wait before the request times out.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

System.InvalidOperationException

HandlerFactory cannot be null - or - DefaultRequestHeaders cannot be null.

See Also