How to add ResponseHandler?

Topics: Web Api
Dec 13, 2011 at 8:55 PM
Edited Dec 13, 2011 at 9:03 PM

I'm trying to add a custom response handler, can some explain what I am missing?

var config = new HttpConfiguration { EnableTestClient = true };
Action<Collection<HttpOperationHandler>> handlers = c => c.Add(new JsonpResponseHandler());
config.ResponseHandlers(handlers);

I'm using the latest preview (6).

 

ta

Ollie

Dec 13, 2011 at 9:37 PM

sorted :)

 

config.ResponseHandlers = (responseHandlers, serviceEndpoint, operationDescriptions) => responseHandlers.Add(new JsonpResponseHandler());