|
|
@ -25,6 +25,12 @@ namespace Apewer.Network |
|
|
|
/// <summary>获取进度的块大小,以字节为单位,默认值:1024(1KB)。</summary>
|
|
|
|
public int Block { get => _block; set => NumberUtility.Restrict(value, 1, 1048576); } |
|
|
|
|
|
|
|
/// <summary>构建 <see cref="HttpClient"/> 的实例。</summary>
|
|
|
|
public HttpClient() |
|
|
|
{ |
|
|
|
RequestHeaders = new StringPairs(); |
|
|
|
} |
|
|
|
|
|
|
|
#region request
|
|
|
|
|
|
|
|
/// <summary>获取或设置将要请求的方法,默认为 GET。</summary>
|
|
|
@ -260,7 +266,7 @@ namespace Apewer.Network |
|
|
|
var body = request.GetRequestStream(); |
|
|
|
BytesUtility.Read(stream, body, RequestProgress, Block); |
|
|
|
} |
|
|
|
else |
|
|
|
else if (data != null) |
|
|
|
{ |
|
|
|
request.ContentLength = data.LongLength; |
|
|
|
var body = request.GetRequestStream(); |
|
|
|