浏览器向服务端发送的消息信息

来源:互联网 发布:淘宝联盟注册条件 编辑:程序博客网 时间:2024/05/17 10:03
POST /index.jsp HTTP/1.1
Host: localhost:2224
Connection: keep-alive
Content-Length: 30
Cache-Control: max-age=0
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1145.0 Safari/537.1
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
Cookie: JSESSIONID=ADF3CD188FD779FF139B8D035BC21507


username=gogole&password=baidu


下面是响应信息:HTTP/1.0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=806ED197713938B0B9669BB9123D0CD8; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 303
Date: Sun, 05 Aug 2012 09:52:27 GMT
Connection: close


<html>
<head>
<title>我的标题</title>
</head>
<body>
<form method="post" action="http://localhost:2224/index.jsp">
username:<input type="text" name="username" />
password:<input type="password" name="password" />
<input type="submit" value="提交"/>
</form>
</body>
</html>

HTTP/1.0响应后会立即关闭连接,而 HTTP/1.1则不会

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=B9985D2F737FAB80435390193F4FAF00; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 303
Date: Sun, 05 Aug 2012 09:54:20 GMT


<html>
<head>
<title>我的标题</title>
</head>
<body>
<form method="post" action="http://localhost:2224/index.jsp">
username:<input type="text" name="username" />
password:<input type="password" name="password" />
<input type="submit" value="提交"/>
</form>
</body>

原创粉丝点击