Class HttpConfiguration
Encapsulates top-level HTTP configuration that applies to all SDK components.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Subsystems
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public sealed class HttpConfiguration
Remarks
Use HttpConfigurationBuilder to construct an instance.
Constructors
| Edit this page View SourceHttpConfiguration(TimeSpan, IEnumerable<KeyValuePair<string, string>>, HttpMessageHandler, IWebProxy, TimeSpan)
Constructs an instance, setting all properties.
Declaration
public HttpConfiguration(TimeSpan connectTimeout, IEnumerable<KeyValuePair<string, string>> defaultHeaders, HttpMessageHandler messageHandler, IWebProxy proxy, TimeSpan readTimeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | connectTimeout | value for ConnectTimeout |
IEnumerable<KeyValuePair<string, string>> | defaultHeaders | value for DefaultHeaders |
HttpMessageHandler | messageHandler | value for MessageHandler |
IWebProxy | proxy | value for Proxy |
TimeSpan | readTimeout | value for ReadTimeout |
HttpConfiguration(TimeSpan, IEnumerable<KeyValuePair<string, string>>, HttpMessageHandler, IWebProxy, TimeSpan, TimeSpan)
Constructs an instance, setting all properties.
Declaration
public HttpConfiguration(TimeSpan connectTimeout, IEnumerable<KeyValuePair<string, string>> defaultHeaders, HttpMessageHandler messageHandler, IWebProxy proxy, TimeSpan readTimeout, TimeSpan responseStartTimeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | connectTimeout | value for ConnectTimeout |
IEnumerable<KeyValuePair<string, string>> | defaultHeaders | value for DefaultHeaders |
HttpMessageHandler | messageHandler | value for MessageHandler |
IWebProxy | proxy | value for Proxy |
TimeSpan | readTimeout | value for ReadTimeout |
TimeSpan | responseStartTimeout | value for ResponseStartTimeout |
Properties
| Edit this page View SourceConnectTimeout
The network connection timeout.
Declaration
public TimeSpan ConnectTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Remarks
This is the time allowed for the underlying HTTP client to connect to the LaunchDarkly server, for any individual network connection.
Not all .NET platforms support setting a connection timeout. It is implemented as
a property of System.Net.Http.SocketsHttpHandler
in .NET Core 2.1+ and .NET
5+, but is unavailable in .NET Framework and .NET Standard. On platforms where it
is not supported, only ResponseStartTimeout will be used.
Since this is implemented only in SocketsHttpHandler
, if you have
specified some other HTTP handler implementation with HttpMessageHandler,
the ConnectTimeout here will be ignored.
See Also
| Edit this page View SourceDefaultHeaders
HTTP headers to be added to all HTTP requests made by the SDK.
Declaration
public IEnumerable<KeyValuePair<string, string>> DefaultHeaders { get; }
Property Value
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> |
Remarks
These include Authorization
, User-Agent
, and any headers that were
specified with CustomHeader(string, string).
MessageHandler
A custom handler for HTTP requests, or null to use the platform's default handler.
Declaration
public HttpMessageHandler MessageHandler { get; }
Property Value
Type | Description |
---|---|
HttpMessageHandler |
Proxy
The proxy configuration, if any.
Declaration
public IWebProxy Proxy { get; }
Property Value
Type | Description |
---|---|
IWebProxy |
Remarks
This is only present if a proxy was specified programmatically with Proxy(IWebProxy), not if it was specified with an environment variable.
ReadTimeout
The network read timeout (socket timeout).
Declaration
public TimeSpan ReadTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Remarks
This is the amount of time without receiving data on a connection that the SDK will tolerate before signaling an error. This does not apply to the streaming connection used by StreamingDataSource(), which has its own non-configurable read timeout based on the expected behavior of the LaunchDarkly streaming service.
ResponseStartTimeout
The maximum amount of time to wait for the beginning of an HTTP response.
Declaration
public TimeSpan ResponseStartTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Remarks
This limits how long the SDK will wait from the time it begins trying to make a
network connection for an individual HTTP request to the time it starts receiving
any data from the server. It is equivalent to the Timeout
property in
HttpClient
.
It is not the same as StartWaitTime(TimeSpan), which limits the time for initializing the SDK regardless of how many individual HTTP requests are done in that time.
See Also
Methods
| Edit this page View SourceNewHttpClient()
Helper method for creating an HTTP client instance using the configured properties.
Declaration
public HttpClient NewHttpClient()
Returns
Type | Description |
---|---|
HttpClient | a client instance |