HTTP Request / Response 报文基本信息结构
2015-05-12 13:43
369 查看
转自: http://tobylxy.iteye.com/blog/1739125
About HTTP Request/Response
Request:
An HTTP request consists of three components:
Method—Uniform
Resource Identifier (URI)—Protocol/Version
Request headers
Entity body
An example of an HTTP request is the following:
-----------------------------------------------
POST /examples/default.jsp HTTP/1.1 --(URI)—Protocol/Version
Accept: text/plain; text/html --Request
Header
Accept-Language: en-gb
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
Content-Length: 33
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
--There
is a blank line(CRLF)
lastName=Franks&firstName=Michael --Entity
Body
-------------------------------------------------
comment:
The CRLF:carriage return/line feed tells the HTTP server whrer the entity body begins.
Response:
An HTTP request consists of three components:
Protocol—Status
code—Description
Response headers
Entity body
An example of an HTTP response is the following:
-----------------------------------------------
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Mon, 5 Jan 2004 13:13:33 GMT
Content-Type: text/html
Last-Modified: Mon, 5 Jan 2004 13:13:12 GMT
Content-Length: 112
<html>
<head>
<title>HTTP Response Example</title>
</head>
<body>
Welcome to Brainy Software
</body>
</html>
------------------------------------------------
About HTTP Request/Response
Request:
An HTTP request consists of three components:
Method—Uniform
Resource Identifier (URI)—Protocol/Version
Request headers
Entity body
An example of an HTTP request is the following:
-----------------------------------------------
POST /examples/default.jsp HTTP/1.1 --(URI)—Protocol/Version
Accept: text/plain; text/html --Request
Header
Accept-Language: en-gb
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
Content-Length: 33
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
--There
is a blank line(CRLF)
lastName=Franks&firstName=Michael --Entity
Body
-------------------------------------------------
comment:
The CRLF:carriage return/line feed tells the HTTP server whrer the entity body begins.
Response:
An HTTP request consists of three components:
Protocol—Status
code—Description
Response headers
Entity body
An example of an HTTP response is the following:
-----------------------------------------------
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Mon, 5 Jan 2004 13:13:33 GMT
Content-Type: text/html
Last-Modified: Mon, 5 Jan 2004 13:13:12 GMT
Content-Length: 112
<html>
<head>
<title>HTTP Response Example</title>
</head>
<body>
Welcome to Brainy Software
</body>
</html>
------------------------------------------------
相关文章推荐
- 005_Http之request获取客户端信息07-编码之response编码
- 怎么查看真实项目的http 请求的请求报文和响应报文,即request和response?只有这样,才能完全彻底明白一个http 请求整个过程,发送和接收的是什么东西。
- node.js http中请求request和响应response信息说明
- HTTP报文基本结构,自己写程序发送http包登陆某些网站。
- [置顶] http协议初探------http request和response报文格式
- HttpWebRequest / HttpWebResponse 远程获取文件信息
- 关于XMLHttpRequest对象的responseText属性
- LoadRunner获取WEB消息头信息的两个内置变量:REQUEST、RESPONSE
- C# URL返回结果并转换编码 c# HttpWebRequest与HttpWebResponse
- 使用ASIHTTPRequest获得天气信息
- request和response操作响应行头体信息
- Http Request 和 Response
- XMLHttpRequest cannot load http://xxx. Response for preflight has invalid HTTP status code 404
- 【RLIB】C++调用HttpRequest 、HttpResponse下载远程HTTP/HTTPS资源
- HttpServletRequest&&HttpServletResponse参数的接收和响应
- http协议、Request和Response、Cookie、HttpSession、JSP
- 运用HttpWebRequest与HttpWebResponse获取Web页数据
- HttpServletRequest和HttpServletResponse详解
- HttpWebRequest.CookieContainer与HttpWebResponse.Cookies的区别和联系
- HttpWebRequest post请求获取webservice void数据信息