예제 #1
0
        /// <summary>
        /// 创建http客户端
        /// </summary>
        /// <returns>http客户端</returns>
        public static HttpClient CreateHttpClient()
        {
            var httpClient = new HttpClient();

            if (GetTokenFunc != null)
            {
                httpClient.AddBearerTokenToHeader(GetTokenFunc());
            }

            return(httpClient);
        }