I saw a small partner in the group asking how to solve this anomaly:
java.lang.IllegalArgumentException: Request header is too large
Abnormal
According to Exception Message Request header is too large
, it can be determined that the cause of this error is caused by the excessively large HTTP request header.
This article first program ape DD blog, welcome to collect and pay attention!
How to solve
The solution is mainly in two directions:
Direction 1: Configure the application server to allow the maximum value> your practical and practical request header data size
If you use Spring Boot, you only need to configure this parameter in the configuration file:
server.max-http-header-size=
Direction 2: Avoid the situation where the request header is too large
Although the above configuration can be solved, if the header part is used uncontrollably, then this parameter will become uncontrollable.
For the data in the request header, it is not recommended to put too much data. Therefore, it is more reasonable to put these data in the body.
So when you encounter this exception, should you choose method one or method two? Or is there another way to solve it? Leave a message and tell me which one do you think is better!
Welcome to pay attention to my public account: Program Ape DD, share knowledge and thoughts that can’t be seen elsewhere
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。