I've got quite a few ApiControllers that all inherit from a custom base class.
With-out having to put base.Authenticate(); in every get, put, delete method in every ApiController how can i capture every request in the base class? I tried this in the constructor; however, the request object is null in my base Webapi controll class.
When you say "capture" what do you imply? do you want to log the request/ autheticate it etc? Either way, consider using a custom delgating handler - this is invoked prior to the control actually hitting the controller.
Hope this helps,
Priya
Please "Mark as Answer" if this resolves your query.
Please "Mark as Answer" if this resolves your query. Thanks!
erikkl2000
Member
257 Points
234 Posts
How to capture every request in a base webapi class
Dec 05, 2012 08:05 PM|LINK
I've got quite a few ApiControllers that all inherit from a custom base class.
With-out having to put base.Authenticate(); in every get, put, delete method in every ApiController how can i capture every request in the base class? I tried this in the constructor; however, the request object is null in my base Webapi controll class.
priya_marwah...
Member
81 Points
52 Posts
Re: How to capture every request in a base webapi class
Dec 13, 2012 11:59 AM|LINK
When you say "capture" what do you imply? do you want to log the request/ autheticate it etc? Either way, consider using a custom delgating handler - this is invoked prior to the control actually hitting the controller.
Hope this helps,
Priya
Please "Mark as Answer" if this resolves your query.