惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - qy1141

Mysql插入Emoji表情出错 spring+mybatis事务不起作用的原因 安卓开发随记 springmvc + spring + ibatis + mysql Eclipse中配置svn J2EE环境配置与工具使用 SqlServer数据库空间使用情况常用命令 数据库备份与还原 关于数据库优化杂技 windows2008吃尽内存的解决办法 在C#中使用消息队列RabbitMQ 重新开博 WCF Security系列(2)--服务器端的安全 WCF Security系列(1)--Security概述 如果为网站生成自签名SSL证书 关于证书 转:最真实的2006年应届毕业生真实薪水 转:如何修复Team Foundation Server Workgroup Edition 不小心删除了所有Team Foundation Licensed Users组内用户问题 转 :TFS(Team Foundation Server)使用经验
asp.net中http提交数据所遇到的那些坑
qy1141 · 2014-11-10 · via 博客园 - qy1141

2014-11-10 17:49  qy1141  阅读(833)  评论()    收藏  举报

http提交数据有两种形式,get和post,不知道的同学请联系度娘。

1、aspnet:MaxHttpCollectionKeys

业务场景:业务很简单,手机端读取本地通讯录,将所有通讯录提交到后台,后台进行业务过滤,返回已属于当前用户好友所在的企业

服务端接口定义如下:

        [HttpPost]
        public List<string> IsInEnt([FromBody]List<string> mobilePhs)

问题描述:如果提交给后台的通讯录超过一定数量,后台接收到的mobilePhs为null,经过反复调试,发现到超过1000条通讯录,就会出现这样的问题,查了相关资料后发现,asp.net默认允许request中key的最大数量为1000。

解决方法:

在web.config中,添加一段配置:

    <!--请求提交的最大键值数-->
    <add key="aspnet:MaxHttpCollectionKeys" value="5000" />
    <!--请求提交的做大Json序列化属性数-->
    <add key="aspnet:MaxJsonDeserializerMembers" value="5000" />

2、ASPMaxRequestEntityAllowed

IIS6.0对提交数据长度也有限制,默认为200k,可在C:\Windows\system32\inesrv\metabase.xml中进行修改:

AspMaxRequestEntityAllowed="204800"

注:此配置有安全隐患,谨慎修改,一般200k数据是足够满足业务场景了,如果再大的数据,建议使用文件传输了。

3、未完待续。。。