ITKeyword,专注技术干货聚合推荐

注册 | 登录

解决asp.net web api - How to filter Request Response before reaching to Web Api controller

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址https://www.aliyun.com/1111/home

推荐:ASP.NET Web API

ASP.NET Web API includes support for the following features: Modern HTTP programming model: Directly access and manipulate HTTP requests and responses

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

asp.net-web-api asp.net-web-api-routing asp.net-web-api2 asp.net-mvc-5.1
|
  this question
edited Feb 26 '14 at 18:10 Kara 3,319 8 33 50 asked Feb 24 '14 at 7:41 Utsav 1,006 3 14 34      You can add filter to the IIS, which can process the requests and responses as you like. iis.net/configreference/system.webserver/security/… I dont know if that is such kind of filtering you need? –  Casper Skoubo Feb 24 '14 at 9:46

 | 

1 Answers
1

解决方法

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.


|
  this answer
answered Feb 24 '14 at 9:58 Jon Susiak 3,923 1 14 31      Yes thanks I was looking for this solution to filter request and response. –  Utsav Feb 24 '14 at 11:00 1   Another article about a DelegatingHandler can be found here: weblogs.asp.net/fredriknormen/… –  Stephan Bauer Jul 23 '15 at 11:18

 | 

推荐:asp.net web api

官方的地址: http://www.asp.net/web-api 里面的资料很全,是学习的第一选择.建议多参考此资料 1.里面最简单直接的例子 http://www.asp.net/web-api/overview/get


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。