Something about HTTP Protocol
2014-11-19 23:06
169 查看
0. An HTTP request consists of three components:* Method—–URI—Protocol/Version* Request headers* Entity bodyAn example of an HTTP request is the following:POST /servlet/default.jsp HTTP/1.1Accept: text/plain; text/html© Budi Kurniawan 2003 2Accept-Language: en-gbConnection: Keep-AliveHost: localhostReferer: http://localhost/ch8/SendDetails.htm User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)Content-Length: 33Content-Type: application/x-www-form-urlencodedAccept-Encoding: gzip, deflateLastName=Franks&FirstName=Michael1. Replacing HTTP/1.0 is the current version of HTTP/1.1, which is defined by RFC 2616 and downloadable from http://www.w3.org/Protocols/HTTP/1.1/rfc2616.pdf 2. HTTP Requests:The method—URI—protocol version appears as the first line of the request.A URL is actually a type of URI (see http://www.ietf.org/rfc/rfc2396.txt).
URI 是从虚拟根路径开始的 URL是整个链接 如URL http://zhidao.baidu.com/question/68016373.html URI 是/question/68016373.html 百度服务器把http://zhidao.baidu.com/制作成了虚拟的路径的根
3. Between the headers and the entity body, there is a blank line (CRLF) that isimportant to the HTTP request format. The CRLF tells the HTTP server where the entitybody begins. In some Internet programming books, this CRLF is considered the fourthcomponent of an HTTP request.
CRLF is carriage return/linefeed
4.Similar to requests, an HTTP response also consists of three parts:
* Protocol—Status code–—Description* Response headers* Entity bodyThe following is an example of an HTTP response:
HTTP/1.1 200 OKServer: Microsoft-IIS/4.0Date: Mon, 3 Jan 1998 13:13:33 GMTContent-Type: text/htmlLast-Modified: Mon, 11 Jan 1998 13:23:42 GMTContent-Length: 112<HTML><HEAD><TITLE>HTTP Response Example</TITLE></HEAD><BODY>Welcome to Brainy Software</BODY></HTML>
相关文章推荐
- Something about the microsoft HttpContext domain design
- Something about http request in angularjs
- restangular: Differences with $resource 接上篇Something about http request in angularjs
- 对WebService的一些封装技巧总结(http://www.cnblogs.com/sxwgf/archive/2011/07/10/something-about-webservice.html
- Something About Perl
- Something About RMSEP
- Myeclipse里tomcat严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]
- Something About Ofiice Develop
- [Collect]Something about IECT'2005
- Something about the git cherry-pick
- curl:<1> Protocol "'http" not supported or disabled in libcurl
- tomcat优化-有改protocol 和 缓存 集群方案 转载自http://passover.blog.51cto.com/2431658/732629
- Erlang ets -- something about cache
- Mybatis异常: protocol = http host = null
- Hypertext Transfer Protocol -- HTTP/1.1
- BitTorrent协议规范(BitTorrent Protocol Specification)之Tracker HTTP/HTTPS Protocol-第三部分
- 利用支付宝的团队编写的 HttpProtocolHandler 、StringRequestEntity 调用微信 支付引发的 body不是UTF8编码的
- [magento]Please enter a valid URL. Protocol is required (http://, https:// or ftp://)
- Something about SharePoint InputFormTextBox
- something about pedestrian detection