Something about HTTP Protocol
来源:互联网 发布:大麻淘宝 编辑:程序博客网 时间:2024/05/21 18:48
0. An HTTP request consists of three components:
* Method—–URI—Protocol/Version
* Request headers
* Entity body
An example of an HTTP request is the following:
POST /servlet/default.jsp HTTP/1.1
Accept: text/plain; text/html
© Budi Kurniawan 2003 2
Accept-Language: en-gb
Connection: Keep-Alive
Host: localhost
Referer: http://localhost/ch8/SendDetails.htm
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
LastName=Franks&FirstName=Michael
1. 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 HTTP Protocol
- Something about http request in angularjs
- Something about ...
- Something about float divide
- something about Tomcat(zz)
- something about Listeners
- something about Macro
- Something about Music
- something about struts
- something about ado
- something about SEO
- Something About Pretect Mode
- something about this week
- Something about Ajax
- something about Ajax Ⅱ
- Something | About db-design
- Something About ! CSS
- Something About FLV视频
- 安卓第三课:关于第四章中的OPENGL【大方向上的介绍】
- hdu5024 网络赛水题
- JavaScript 中的多线程通信
- 几个数据库会议
- org.apache.commons.beanutils.BeanUtils 自定义转换 java 8 localdatetime 类
- Something about HTTP Protocol
- IOS开发中获取自带的应用
- 几年前之所预言,其人不死言之依然
- angular输出html
- Unity3D学习之脚本入门(选择结构和循环结构)
- 如何在Linux下解压tar.lz文件
- 2014-11-19(a tough day)
- Android缓存框架--ASimpleCache
- 输入一个日期判断是星期几 java