/// <summary> /// Initializes a new instance of the <see cref="WebConnection"/> class. /// </summary> /// <param name="tunnel">The tunnel this connection is associated with.</param> /// <param name="context">The context.</param> public WebConnection(WebTunnel tunnel, HttpContext context) : base(tunnel.Id) { _tunnel = tunnel; _context = context; _interceptor = new WebConnectionResponseInterceptor(context.Response); _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(context.RequestAborted); }
/// <summary> /// 追加一个响应拦截器。 /// </summary> /// <param name="interceptor"></param> /// <returns></returns> public virtual BasicHttpClientBuilder AddResponseInterceptor(HttpResponseInterceptor interceptor) { if (interceptor == null) { throw new ArgumentNullException(nameof(interceptor)); } ResponseInterceptors.Add(interceptor); return(this); }
public virtual Org.Apache.Http.Protocol.HttpProcessorBuilder AddLast(HttpResponseInterceptor e) { if (e == null) { return(this); } GetResponseChainBuilder().AddLast(e); return(this); }
/// <summary>Adds this protocol interceptor to the tail of the protocol processing list. /// </summary> /// <remarks> /// Adds this protocol interceptor to the tail of the protocol processing list. /// <p/> /// Please note this value can be overridden by the /// <see cref="SetHttpProcessor(Apache.Http.Protocol.HttpProcessor)">SetHttpProcessor(Apache.Http.Protocol.HttpProcessor) /// </see> /// method. /// </remarks> public Apache.Http.Impl.Client.HttpClientBuilder AddInterceptorLast(HttpResponseInterceptor itcp) { if (itcp == null) { return(this); } if (responseLast == null) { responseLast = new List <HttpResponseInterceptor>(); } responseLast.AddLast(itcp); return(this); }
IHttpClientBuilder IHttpClientBuilder.AddResponseInterceptor(HttpResponseInterceptor interceptor) { return(this.AddResponseInterceptor(interceptor)); }
/// <summary> /// 追加一个响应拦截器。 /// </summary> /// <param name="interceptor"></param> /// <returns></returns> public new WxpayApiClientBuilder AddResponseInterceptor(HttpResponseInterceptor interceptor) { base.AddResponseInterceptor(interceptor); return(this); }
public virtual Org.Apache.Http.Protocol.HttpProcessorBuilder Add(HttpResponseInterceptor e) { return(AddLast(e)); }