有没有一种方法来设置maxAllowedContentLength /每maxRequestLength的控制器在的WebAPI [英] Is there a way to set maxAllowedContentLength/maxRequestLength per Controller in WebAPI

查看:1152
本文介绍了有没有一种方法来设置maxAllowedContentLength /每maxRequestLength的控制器在的WebAPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个控制器,处理文件上传和需要大量超时和文件。
在另一方面,我有几个控制器,应以更及时地执行,并想借此较低的maxRequestLength的和executionTimeout的提供的安全优势。

I have several controllers that handle file uploads and require large timeouts and files. On the other hand I have several controllers that should execute in a more timely fashion, and would like to take advantage of the security provided by lower maxRequestLength's and executionTimeout's.

我想有一定的网络API控制器或动作可以设置maxAllowedContentLength /的maxRequestLength / executionTimeout让每一个动作或控制器可以指定它自己的要求。

I would like to have certain web api controllers or actions be able to set maxAllowedContentLength/maxRequestLength/executionTimeout so that each action or controller can specify it's own requirements.

这可能吗?

推荐答案

您可以掰开控制器到同一网站下的所有托管单独的服务端点,但使用单独的配置每个

You could break apart the controllers into separate service endpoints all hosted under the same site, but using separate configuration for each.

这篇关于有没有一种方法来设置maxAllowedContentLength /每maxRequestLength的控制器在的WebAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆