开发者

What is MaxJSONlength good for?

开发者 https://www.devze.com 2023-03-06 02:54 出处:网络
So I recently had a problem in my MVC project. When asking for a JSON response, all I got was an empty string. Setting the MaxJSONlength to a bigger value solved this problem, but I\'m a bit unsure as

So I recently had a problem in my MVC project. When asking for a JSON response, all I got was an empty string. Setting the MaxJSONlength to a bigger value solved this problem, but I'm a bit unsure as to what it's good for? Is it to protect your server/clients from sending/receiving too much data? Is it Because the serializer needs to know how large an object might be? Neither google n开发者_StackOverflowor MSDN had the answers for these questions.

It feels a bit... strange to me to limit an object's size, but I'm probably gravely mistaken in that thought.

I hope someone can clear this up for me,

Thanks in advance


There is a 4MB of Unicode string default limit that was defined for the JavaScriptSerializer. JSON is a wire format and sending large datasets over networks might hurt the performance of the application. So this limit is like an alarm that you can turn off in the morning and continue sleeping but there is a risk you will be late for work.

0

精彩评论

暂无评论...
验证码 换一张
取 消