LaunchDarkly Dotnet Server SDK
Search Results for

    Show / Hide Table of Contents

    Class HttpConfiguration

    Encapsulates top-level HTTP configuration that applies to all SDK components.

    Inheritance
    object
    HttpConfiguration
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 Source

    HttpConfiguration(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

    | Edit this page View Source

    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 Source

    ConnectTimeout

    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
    ResponseStartTimeout
    | Edit this page View Source

    DefaultHeaders

    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).

    | Edit this page View Source

    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
    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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
    ConnectTimeout

    Methods

    | Edit this page View Source

    NewHttpClient()

    Helper method for creating an HTTP client instance using the configured properties.

    Declaration
    public HttpClient NewHttpClient()
    Returns
    Type Description
    HttpClient

    a client instance

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX