Class HttpManagerOptions
Specifies options that is related to the HttpManager class.
Inheritance
Namespace: Cuemon.Net.Http
Assembly: Cuemon.Net.dll
Syntax
public class HttpManagerOptions
Constructors
| Improve this DocHttpManagerOptions()
Initializes a new instance of the HttpManagerOptions class.
Declaration
public HttpManagerOptions()
Remarks
The following table shows the initial property values for an instance of HttpManagerOptions.
Property | Initial Value |
---|---|
DisposeHandler | true |
DefaultRequestHeaders | Connection: Keep-Alive |
HandlerFactory | System.Net.Http.HttpClientHandler initialized with System.Net.Http.HttpClientHandler.AutomaticDecompression for GZip|Deflate and System.Net.Http.HttpClientHandler.MaxAutomaticRedirections to 10. |
Timeout | 2 minutes |
Properties
| Improve this DocDefaultRequestHeaders
Gets the default headers which should be sent with each request.
Declaration
public Dictionary<string, string> DefaultRequestHeaders { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.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().
Declaration
public bool DisposeHandler { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
HandlerFactory
Gets the HTTP handler stack to use for sending requests.
Declaration
public Func<HttpMessageHandler> HandlerFactory { get; }
Property Value
Type | Description |
---|---|
System.Func<System.Net.Http.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.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The timespan to wait before the request times out. |
Methods
| Improve this DocSetHandlerFactory<T>(Action<T>)
Sets the HandlerFactory property using the specified setup
.
Declaration
public void SetHandlerFactory<T>(Action<T> setup)
where T : HttpMessageHandler
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | setup | The |
Type Parameters
Name | Description |
---|---|
T | The type of the System.Net.Http.HttpMessageHandler to use. |