using System;
using System.Net.Http;

namespace Alibabacloud.Rum.Unity.Network
{
    /// <summary>
    /// This class is for internal use only and should not be used directly.
    /// </summary>
    [Obsolete("This class is for internal use only and will be removed in a future version.")]
    internal static class HttpClientFactory
    {
        internal static HttpClient CreateInstrumentedHttpClient(HttpMessageHandler innerHandler = null)
        {
            innerHandler ??= new HttpClientHandler();

            var options = AlibabacloudSdk.Instance.Options;
            var handler = new InstrumentedHttpMessageHandler(innerHandler, options);
            return new HttpClient(handler);
        }
    }
}
