|
|
|
@ -174,7 +174,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying
|
|
|
|
|
var response = await client.SendAsync(
|
|
|
|
|
requestMessage,
|
|
|
|
|
HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/,
|
|
|
|
|
GetCancellationToken()
|
|
|
|
|
GetCancellationToken(invocation)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!response.IsSuccessStatusCode)
|
|
|
|
@ -306,8 +306,18 @@ namespace Volo.Abp.Http.Client.DynamicProxying
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual CancellationToken GetCancellationToken()
|
|
|
|
|
protected virtual CancellationToken GetCancellationToken(IAbpMethodInvocation invocation)
|
|
|
|
|
{
|
|
|
|
|
var cancellationTokenArg = invocation.Arguments.LastOrDefault(x => x is CancellationToken);
|
|
|
|
|
if (cancellationTokenArg != null)
|
|
|
|
|
{
|
|
|
|
|
var cancellationToken = (CancellationToken) cancellationTokenArg;
|
|
|
|
|
if (cancellationToken != default)
|
|
|
|
|
{
|
|
|
|
|
return cancellationToken;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CancellationTokenProvider.Token;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|