/// <summary>Creates a new instance of the <see cref="T:System.Net.Http.HttpClient" /> which should be pipelined.</summary> /// <returns>A new instance of the <see cref="T:System.Net.Http.HttpClient" /> which should be pipelined.</returns> /// <param name="innerHandler">The inner handler which is responsible for processing the HTTP response messages.</param> /// <param name="handlers">The list of HTTP handler that delegates the processing of HTTP response messages to another handler.</param> public static HttpMessageHandler CreatePipeline(HttpMessageHandler innerHandler, IEnumerable<DelegatingHandler> handlers) { if (innerHandler == null) { throw Error.ArgumentNull("innerHandler"); } if (handlers == null) { return innerHandler; } HttpMessageHandler handler = innerHandler; foreach (DelegatingHandler handler2 in handlers.Reverse<DelegatingHandler>()) { if (handler2 == null) { // todo: reenable error throw throw Error.Argument("handlers", FSR.DelegatingHandlerArrayContainsNullItem, new object[] { typeof(DelegatingHandler).Name }); } if (handler2.InnerHandler != null) { // todo: reenable error throw throw Error.Argument("handlers", FSR.DelegatingHandlerArrayHasNonNullInnerHandler, new object[] { typeof(DelegatingHandler).Name, "InnerHandler", handler2.GetType().Name }); } handler2.InnerHandler = handler; handler = handler2; } return handler; }
/// <summary>Creates a new instance of the <see cref="T:NMasters.Silverlight.Net.Http.Handlers.DelegatingHandler" /> class with a specific inner handler.</summary> /// <param name="innerHandler">The inner handler which is responsible for processing the HTTP response messages.</param> protected DelegatingHandler(HttpMessageHandler innerHandler) { this.InnerHandler = innerHandler; }
/// <summary>Initializes an instance of a <see cref="T:NMasters.Silverlight.Net.Http.HttpMessageInvoker" /> class with a specific <see cref="T:NMasters.Silverlight.Net.Http.HttpMessageHandler" />.</summary> /// <param name="handler">The <see cref="T:NMasters.Silverlight.Net.Http.Handlers.HttpMessageHandler" /> responsible for processing the HTTP response messages.</param> /// <param name="disposeHandler">true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler.</param> public HttpMessageInvoker(HttpMessageHandler handler, bool disposeHandler) { _handler = handler; _disposeHandler = disposeHandler; }
/// <summary>Initializes an instance of a <see cref="T:NMasters.Silverlight.Net.Http.HttpMessageInvoker" /> class with a specific <see cref="T:NMasters.Silverlight.Net.Http.HttpMessageHandler" />.</summary> /// <param name="handler">The <see cref="T:NMasters.Silverlight.Net.Http.Handlers.HttpMessageHandler" /> responsible for processing the HTTP response messages.</param> public HttpMessageInvoker(HttpMessageHandler handler) : this(handler, true) { }
/// <summary>Creates an instance of a <see cref="T:NMasters.Silverlight.Net.Http.Handlers.MessageProcessingHandler" /> class with a specific inner handler.</summary> /// <param name="innerHandler">The inner handler which is responsible for processing the HTTP response messages.</param> protected MessageProcessingHandler(HttpMessageHandler innerHandler) : base(innerHandler) { }
/// <summary>Creates a new instance of the <see cref="T:System.Net.Http.HttpClient" />.</summary> /// <returns>A new instance of the <see cref="T:System.Net.Http.HttpClient" />.</returns> /// <param name="innerHandler">The inner handler which is responsible for processing the HTTP response messages.</param> /// <param name="handlers">The list of HTTP handler that delegates the processing of HTTP response messages to another handler.</param> public static HttpClient Create(HttpMessageHandler innerHandler, params DelegatingHandler[] handlers) { return new HttpClient(CreatePipeline(innerHandler, handlers)); }
/// <summary>Initializes a new instance of the <see cref="T:NMasters.Silverlight.Net.Http.HttpClient" /> class with a specific handler.</summary> /// <param name="handler">The <see cref="T:NMasters.Silverlight.Net.Http.HttpMessageHandler" /> responsible for processing the HTTP response messages.</param> /// <param name="disposeHandler">true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler.</param> public HttpClient(HttpMessageHandler handler, bool disposeHandler) : base(handler, disposeHandler) { }
/// <summary>Initializes a new instance of the <see cref="T:NMasters.Silverlight.Net.Http.HttpClient" /> class with a specific handler.</summary> /// <param name="handler">The HTTP handler stack to use for sending requests. </param> public HttpClient(HttpMessageHandler handler) : this(handler, true) { }