zhaolei
2020-11-20 4a2e5b9a21940f11757be37d99f0944e240e908b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Net.Http;
 
namespace Bootstrap.Admin
{
    /// <summary>
    /// Gitee HttpClient 操作类
    /// </summary>
    public class GiteeHttpClient
    {
        /// <summary>
        /// HttpClient 实例
        /// </summary>
        public HttpClient HttpClient { get; private set; }
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="client"></param>
        public GiteeHttpClient(HttpClient client)
        {
            client.Timeout = TimeSpan.FromSeconds(10);
            client.DefaultRequestHeaders.Connection.Add("keep-alive");
            HttpClient = client;
        }
    }
}