using XF.Domain.Exceptions;

namespace DataSharing
{
    public static class HttpClientExtensions
    {
        public static HttpClient SetBaseAddress(this HttpClient httpClient, string baseAddress)
        {
            if (string.IsNullOrEmpty(baseAddress))
                throw new UserFriendlyException("无效 base address");
            httpClient.BaseAddress = new Uri(baseAddress);
            return httpClient;
        }
    }
}
