前端提交数据后http状态码400

报错如下:

分析原因:

前端Cookie使用过多,储存数据过大

 

解决方案:

方案一:

Nginx配置文件nginx.conf中 把请求头内存调大

client_header_buffer_size 32k;
large_client_header_buffers 4 32k;

方案二:

前端删除部分Cookie,用H5中的本地储存localStorage代替

<!DOCTYPE html>
<html>
<body>

<div id="result"></div>

<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
    // Store
    localStorage.setItem("lastname", "Gates");
    // Retrieve
    document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
    document.getElementById("result").innerHTML = "抱歉!您的浏览器不支持 Web Storage ...";
}
</script>

</body>
</html>

  

 

posted @ 2024-03-14 14:17  靓仔姓曹  阅读(49)  评论(0编辑  收藏  举报
  
爱,其实很简单,困难的是去接受它。