Pipeline component for client side stack

Topics: Web Api
Aug 30, 2011 at 10:28 PM

Does anybody know whether there is a pipeline injection path (similiar to HttpMessageInspector on the server side) available on the client. This is analogous to the client behavior on the WCF SOAP side.

Aug 31, 2011 at 2:19 AM

Yes, you can create a new Delegating channel on the client and then assign an instance of it to HttpClient.Channel.  

Sep 6, 2011 at 7:22 PM

Darrel, Is there a sample that you could point me too..

Sep 7, 2011 at 2:59 PM

In my RESTAgent project I have a FakeWebRequestChannel that allows me to unit test.  See http://restagent.codeplex.com/SourceControl/changeset/view/2c853fd27a39#src%2fRESTAgent.Tests%2fRestAgentTests.cs  This particular fake derives from WebRequestChannel, but you also can just derive from the base class which used to be DelegatingChannel but now I think it is called HttpMessageHandler.