Skip to content

Commit 0b6d23f

Browse files
committed
重命名
1 parent 890e4d4 commit 0b6d23f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

WebApiClient/Defaults/DefaultHttpClient.cs renamed to WebApiClient/Defaults/HttpClient.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@
1111

1212
namespace WebApiClient.Defaults
1313
{
14-
1514
/// <summary>
1615
/// 表示默认的HttpClient
1716
/// </summary>
18-
public class DefaultHttpClient : IHttpClient
17+
public class HttpClient : IHttpClient
1918
{
2019
/// <summary>
2120
/// HttpClient实例
2221
/// </summary>
23-
private HttpClient client;
22+
private System.Net.Http.HttpClient client;
2423

2524
/// <summary>
2625
/// 是否已释放
@@ -82,10 +81,11 @@ public long MaxResponseContentBufferSize
8281
this.client.MaxResponseContentBufferSize = value;
8382
}
8483
}
84+
8585
/// <summary>
8686
/// 默认的HttpClient
8787
/// </summary>
88-
public DefaultHttpClient() :
88+
public HttpClient() :
8989
this(() => new DefaultHttpClientHandler())
9090
{
9191
}
@@ -95,7 +95,7 @@ public DefaultHttpClient() :
9595
/// </summary>
9696
/// <param name="handlerProvider">HttpClientHandler提供者,要求每调用一次返回一个新实例</param>
9797
/// <exception cref="ArgumentNullException"></exception>
98-
public DefaultHttpClient(Func<HttpClientHandler> handlerProvider)
98+
public HttpClient(Func<HttpClientHandler> handlerProvider)
9999
{
100100
if (handlerProvider == null)
101101
{
@@ -104,7 +104,7 @@ public DefaultHttpClient(Func<HttpClientHandler> handlerProvider)
104104

105105
this.handlerProvider = handlerProvider;
106106
this.Handler = handlerProvider.Invoke();
107-
this.client = new HttpClient(this.Handler);
107+
this.client = new System.Net.Http.HttpClient(this.Handler);
108108
}
109109

110110
/// <summary>
@@ -204,7 +204,7 @@ private void InitWithoutProxy()
204204
handler.UseProxy = false;
205205
handler.Proxy = null;
206206

207-
var httpClient = new HttpClient(handler);
207+
var httpClient = new System.Net.Http.HttpClient(handler);
208208
this.CopyProperties(this.client, httpClient);
209209
this.client.Dispose();
210210

WebApiClient/Defaults/DefaultKeyValueFormatter.cs renamed to WebApiClient/Defaults/KeyValueFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
namespace WebApiClient.Defaults
1313
{
1414
/// <summary>
15-
/// 默认键值对列化工具
15+
/// 表示默认键值对列化工具
1616
/// </summary>
17-
public class DefaultKeyValueFormatter : IKeyValueFormatter
17+
public class KeyValueFormatter : IKeyValueFormatter
1818
{
1919
/// <summary>
2020
/// 序列化参数为键值对

WebApiClient/HttpApiConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class HttpApiConfig : IDisposable
2222
/// <summary>
2323
/// 获取默认KeyValue格式化工具唯一实例
2424
/// </summary>
25-
public static readonly IKeyValueFormatter DefaultKeyValueFormatter = new DefaultKeyValueFormatter();
25+
public static readonly IKeyValueFormatter DefaultKeyValueFormatter = new KeyValueFormatter();
2626

2727
/// <summary>
2828
/// 与HttpClientHandler实例关联的HttpClient
@@ -44,7 +44,7 @@ public IHttpClient HttpClient
4444

4545
if (this.httpClient == null)
4646
{
47-
this.httpClient = new DefaultHttpClient();
47+
this.httpClient = new HttpClient();
4848
}
4949
return this.httpClient;
5050
}

0 commit comments

Comments
 (0)