消息头的响应头中有字段Content-Length
- 作用是描述HTTP消息实体的传输长度
- 浏览器通过Content-Length可以得知本次传输何时结束
下面根据已知响应体长度设置不同的Content-Length来观察具体表现
一.前端代码展示:
<%--
Created by IntelliJ IDEA.
User: WHW
Date: 2019/7/23
Time: 18:27
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
<b>已知:</b><br/>
消息体为:"ABCDEFGHIJKLMN"<br/>
bodyLength=14<br/>
<b>设置Content-Length:</b>
<fieldset>
<a href="http://localhost:8080/rr/cls?value=13">13</a>
</fieldset>
<fieldset>
<a href="http://localhost:8080/rr/cls?value=14">14</a>
</fieldset>