|
|
|
@ -7,7 +7,6 @@ using System.Net.Http.Headers; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Castle.DynamicProxy; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Microsoft.Extensions.Primitives; |
|
|
|
using Volo.Abp.Content; |
|
|
|
@ -44,8 +43,6 @@ public class ClientProxyBase<TService> : ITransientDependency |
|
|
|
protected ICurrentApiVersionInfo CurrentApiVersionInfo => LazyServiceProvider.LazyGetRequiredService<ICurrentApiVersionInfo>(); |
|
|
|
protected ILocalEventBus LocalEventBus => LazyServiceProvider.LazyGetRequiredService<ILocalEventBus>(); |
|
|
|
|
|
|
|
protected IOptions<AbpHttpClientExecuteHttpActionOptions> ExecuteHttpActionOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpHttpClientExecuteHttpActionOptions>>(); |
|
|
|
|
|
|
|
protected virtual async Task RequestAsync(string methodName, ClientProxyRequestTypeValue? arguments = null) |
|
|
|
{ |
|
|
|
await RequestAsync(BuildHttpProxyClientProxyContext(methodName, arguments)); |
|
|
|
@ -148,9 +145,11 @@ public class ClientProxyBase<TService> : ITransientDependency |
|
|
|
|
|
|
|
HttpResponseMessage response; |
|
|
|
try |
|
|
|
{ |
|
|
|
//Allows users to customize the timeout for remote methods of specific requests
|
|
|
|
ExecuteHttpActionOptions.Value.ExecuteHttpAction?.Invoke(requestContext.Action, client); |
|
|
|
{ |
|
|
|
foreach (var preSendAction in ClientOptions.Value.ProxyHttpClientPreSendActions.Where(x => x.Key == clientConfig.RemoteServiceName).Select(x => x.Value)) |
|
|
|
{ |
|
|
|
preSendAction(clientConfig, requestContext, client); |
|
|
|
} |
|
|
|
|
|
|
|
response = await client.SendAsync( |
|
|
|
requestMessage, |
|
|
|
|