Пример #1
0
 public HttpClientWrapper(IHttpRequest request)
 {
     _client        = request.GetAsyncInvoker();
     _shouldDicpose = false;
     if (_client == null)
     {
         _shouldDicpose = true;
         _client        = HttpClientProvider.GetClient(request.Proxy);
     }
 }
Пример #2
0
 /// <summary>
 /// 获取一个用于异步请求的
 /// </summary>
 HttpMessageInvoker IHttpRequest.GetAsyncInvoker() => _client ?? (_client = HttpClientProvider.GetClient(Proxy));