예제 #1
0
        internal PrivateConnection(IServerSettings settings, Func <HttpClientHandler> handlerFactory, ILogger logger)
        {
            this.settings = settings;
            this.logger   = logger;

            handler      = handlerFactory();
            httpClient   = new HttpClient(handler);
            messageHook  = DefaultMessageHook;
            clientHook   = DefaultClientHook;
            handlerHook  = DefaultHandlerHook;
            responseHook = DefaultResponseHook;
        }
예제 #2
0
 internal PrivateConnection(ServerSettings settings, Func <CookieContainer> cookieFactory)
 {
     this.settings = settings;
     handler       = new HttpClientHandler {
         CookieContainer = cookieFactory()
     };
     httpClient   = new HttpClient(handler);
     messageHook  = DefaultMessageHook;
     clientHook   = DefaultClientHook;
     handlerHook  = DefaultHandlerHook;
     responseHook = DefaultResponseHook;
 }
예제 #3
0
 public PrivateConnection AppendHook(HttpReponseHook hook)
 {
     responseHook += hook;
     return(this);
 }