11

Hi I am working with Web Api 2, is their any way I can handle request and response before reaching to the API controller.

1

1 Answer 1

10

You may be looking for a DelegatingHandler. These are HTTP Message Handlers that can process the request before it reaches the Controller and can also process the response on the way out of the pipeline. Delegating Handlers can also return the response themselves without calling the rest of the pipeline. You can read about Delegating Handlers here.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes thanks I was looking for this solution to filter request and response.
Another article about a DelegatingHandler can be found here: weblogs.asp.net/fredriknormen/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.