コード例 #1
0
 public HttpClientHandler()
 {
     _underlyingHandler = new HttpHandlerType();
     if (DiagnosticsHandler.IsGloballyEnabled())
     {
         _diagnosticsHandler = new DiagnosticsHandler(_underlyingHandler);
     }
     ClientCertificateOptions = ClientCertificateOption.Manual;
 }
コード例 #2
0
ファイル: HttpClientHandler.cs プロジェクト: sotaieb/runtime
        public HttpClientHandler()
        {
#if TARGET_BROWSER
            _underlyingHandler = new BrowserHttpHandler();
#else
            _underlyingHandler = new SocketsHttpHandler();
#endif
            if (DiagnosticsHandler.IsGloballyEnabled())
            {
                _diagnosticsHandler = new DiagnosticsHandler(_underlyingHandler);
            }
            ClientCertificateOptions = ClientCertificateOption.Manual;
        }
コード例 #3
0
        public HttpClientHandler()
        {
            _underlyingHandler = new HttpHandlerType();

#if TARGET_BROWSER
            Handler = _underlyingHandler;
            if (DiagnosticsHandler.IsGloballyEnabled())
            {
                Handler = new DiagnosticsHandler(Handler, DistributedContextPropagator.Current);
            }
#endif

            ClientCertificateOptions = ClientCertificateOption.Manual;
        }
コード例 #4
0
        protected internal override Task <HttpResponseMessage> SendAsync(HttpRequestMessage request,
                                                                         CancellationToken cancellationToken)
        {
            if (DiagnosticsHandler.IsGloballyEnabled() && _diagnosticsHandler != null)
            {
                return(_diagnosticsHandler !.SendAsync(request, cancellationToken));
            }

            if (IsNativeHandlerEnabled)
            {
                return(_nativeHandler !.SendAsync(request, cancellationToken));
            }
            else
            {
                return(_socketHandler !.SendAsync(request, cancellationToken));
            }
        }
コード例 #5
0
        public HttpClientHandler()
        {
            HttpMessageHandler handler;

            if (IsNativeHandlerEnabled)
            {
                _nativeHandler = CreateNativeHandler();
                handler        = _nativeHandler;
            }
            else
            {
                _socketHandler = new SocketsHttpHandler();
                handler        = _socketHandler;
            }

            if (DiagnosticsHandler.IsGloballyEnabled())
            {
                _diagnosticsHandler = new DiagnosticsHandler(handler, DistributedContextPropagator.Current);
            }
        }