mirror of https://github.com/abpframework/abp.git
committed by
GitHub
7 changed files with 64 additions and 37 deletions
@ -1,13 +1,25 @@ |
|||||
using System.Net.Http; |
using System.Net.Http; |
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
namespace Volo.Abp.Http.Client.DynamicProxying |
namespace Volo.Abp.Http.Client.DynamicProxying |
||||
{ |
{ |
||||
public class DefaultDynamicProxyHttpClientFactory : IDynamicProxyHttpClientFactory, ITransientDependency |
public class DefaultDynamicProxyHttpClientFactory : IDynamicProxyHttpClientFactory, ITransientDependency |
||||
{ |
{ |
||||
public HttpClient Create() |
private readonly IHttpClientFactory _httpClientFactory; |
||||
|
|
||||
|
public DefaultDynamicProxyHttpClientFactory(IHttpClientFactory httpClientFactory) |
||||
|
{ |
||||
|
_httpClientFactory = httpClientFactory; |
||||
|
} |
||||
|
|
||||
|
public HttpClient Create() |
||||
|
{ |
||||
|
return _httpClientFactory.CreateClient(); |
||||
|
} |
||||
|
|
||||
|
public HttpClient Create(string name) |
||||
{ |
{ |
||||
return new HttpClient(); |
return _httpClientFactory.CreateClient(name); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
Loading…
Reference in new issue