[Fiddler] Error:Content-Length mismatch: Request Header indicated 16 bytes, but client sent 0 bytes.

简介: [Fiddler] Error:Content-Length mismatch: Request Header indicated 16 bytes, but client sent 0 bytes.

[Fiddler] Error:Content-Length mismatch: Request Header indicated 16 bytes, but client sent 0 bytes.

 

The error is because of do "location.reload();" after "$.ajax()".

Remove "location.reload();" will fix the issue.

 

 $.ajax({
                type: 'POST',
                url: pageUrl,
                data: JSON.stringify(parameter),
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (data) {
                    onSuccess(data);
                },
                error: function (data, success, error) {
                    alert("Error : " + error);
                }
            });

 

Another same cause error:
2299 Failed to obtain request body. System.IO.InvalidDataException The request body did not contain the specified number of bytes. Got 0, expected 19

 

So how to do refresh page after ajax:

$.ajax({
                type: 'POST',
                url: pageUrl,
                data: JSON.stringify(parameter),
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (data) {
                    onSuccess(data);
                },
                error: function (data, success, error) {
                    alert("Error : " + error);
                },
                complete: function () {
                    setTimeout(function () {
                        window.location.reload();
                    }, 1000);
                }
            });


 

目录
相关文章
|
4月前
|
中间件 应用服务中间件 Apache
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
41 0
|
4月前
|
JSON 数据格式
axios.post请求出错:Request header field content-type is not allowed by Access-Control-Allow-Headers in……
axios.post请求出错:Request header field content-type is not allowed by Access-Control-Allow-Headers in……
|
9月前
|
前端开发 JavaScript
ajax请求的重定向处理--Request header field x-requested-with is not allowed by Access-Control-Allow-Header
ajax请求的重定向处理--Request header field x-requested-with is not allowed by Access-Control-Allow-Header
318 0
|
缓存 前端开发 JavaScript
浏览器报错:net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
浏览器报错:net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
1291 0
|
对象存储
上传文件到OSS报错:[Server]Unable to execute HTTP request: Position is not equal to file length
上传文件到OSS报错:[Server]Unable to execute HTTP request: Position is not equal to file length
1031 0
|
存储 缓存 应用服务中间件
解决问题:net::ERR_CONTENT_LENGTH_MISMATCH 206 (Partial Content)
问题 今天遇到一个问题,Web 播放器在播放对象存储服务中的某个视频文件时,总是不断的报错 206(Partial Content),具体的信息如下: net::ERR_CONTENT_LENGTH_MISMATCH 206 (Partial Content) 造成的结果就是视频播放失败。 播放器报错截图如下:
1272 0
解决问题:net::ERR_CONTENT_LENGTH_MISMATCH 206 (Partial Content)
|
Web App开发 Java 关系型数据库
Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unex
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} span.s1 {font: 12.
4411 0

热门文章

最新文章