- 浏览: 2649598 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
80后的童年2:
深入浅出MongoDB应用实战开发网盘地址:https://p ...
MongoDB入门教程 -
shliujing:
楼主在不是精通java和php的前提下,请不要妄下结论。
PHP、CakePHP哪凉快哪呆着去 -
安静听歌:
希望可以一给一点点注释
MySQL存储过程之代码块、条件控制、迭代 -
qq287767957:
PHP是全宇宙最强的语言!
PHP、CakePHP哪凉快哪呆着去 -
rryymmoK:
深入浅出MongoDB应用实战开发百度网盘下载:链接:http ...
MongoDB入门教程
Request
Request = Request-Line
*(( general-header
| request-header
| entity-header ) CRLF)
CRLF
[ message-body ]
Request-Line
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
An example Request-Line would be:
GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
The Method token indicates the method to be performed on the resource identified by the Request-URI
The method is case-sensitive
Method = "OPTIONS"
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "TRACE"
| "CONNECT"
| extension-method
extension-method = token
The methods GET and HEAD MUST be supported by all general-purpose servers. All other methods are OPTIONAL
An origin server SHOULD return the status code 405 (Method Not Allowed) if the method is known by the origin server but not allowed for the requested resource, and 501 (Not Implemented) if the method is unrecognized or not implemented by the origin server
Request-URI = "*" | absoluteURI | abs_path | authority
The asterisk "*" means that the request does not apply to a particular resource, but to the server itself, and is only allowed when the method used does not necessarily apply to a resource
The Resource Identified by a Request
The exact resource identified by an Internet request is determined by examining both the Request-URI and the Host header field
1. If Request-URI is an absoluteURI, the host is part of the Request-URI. Any Host header field value in the request MUST be ignored.
2. If the Request-URI is not an absoluteURI, and the request includes a Host header field, the host is determined by the Host header field value.
3. If the host as determined by rule 1 or 2 is not a valid host on the server, the response MUST be a 400 (Bad Request) error message.
Request Header Fields
request-header = Accept
| Accept-Charset
| Accept-Encoding
| Accept-Language
| Authorization
| Expect
| From
| Host
| If-Match
| If-Modified-Since
| If-None-Match
| If-Range
| If-Unmodified-Since
| Max-Forwards
| Proxy-Authorization
| Range
| Referer
| TE
| User-Agent
| Range
| Referer
| TE
| User-Agent
New or experimental header fields MAY be given the semantics of request- header fields if all parties in the communication recognize them to be request-header fields
Unrecognized header fields are treated as entity-header fields
Response
Response = Status-Line
*(( general-header
| response-header
| entity-header ) CRLF)
CRLF
[ message-body ]
Status-Line
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
The first digit of the Status-Code defines the class of response
There are 5 values for the first digit:
- 1xx: Informational - Request received, continuing process
- 2xx: Success - The action was successfully received,
understood, and accepted
- 3xx: Redirection - Further action must be taken in order to
complete the request
- 4xx: Client Error - The request contains bad syntax or cannot
be fulfilled
- 5xx: Server Error - The server failed to fulfill an apparently
valid request
Status-Code =
"100" ; Continue
| "101" ; Switching Protocols
| "200" ; OK
| "201" ; Created
| "202" ; Accepted
| "203" ; Non-Authoritative Information
| "204" ; No Content
| "205" ; Reset Content
| "206" ; Partial Content
| "300" ; Multiple Choices
| "301" ; Moved Permanently
| "302" ; Found
| "303" ; See Other
| "304" ; Not Modified
| "305" ; Use Proxy
| "307" ; Temporary Redirect
| "400" ; Bad Request
| "401" ; Unauthorized
| "402" ; Payment Required
| "403" ; Forbidden
| "404" ; Not Found
| "405" ; Method Not Allowed
| "406" ; Not Acceptable
| "407" ; Proxy Authentication Required
| "408" ; Request Time-out
| "409" ; Conflict
| "410" ; Gone
| "411" ; Length Required
| "412" ; Precondition Failed
| "413" ; Request Entity Too Large
| "414" ; Request-URI Too Large
| "415" ; Unsupported Media Type
| "416" ; Requested range not satisfiable
| "417" ; Expectation Failed
| "500" ; Internal Server Error
| "501" ; Not Implemented
| "502" ; Bad Gateway
| "503" ; Service Unavailable
| "504" ; Gateway Time-out
| "505" ; HTTP Version not supported
| extension-code
extension-code = 3DIGIT
Reason-Phrase = *<TEXT, excluding CR, LF>
pplications MUST understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response MUST NOT be cached
Response Header Fields
response-header = Accept-Ranges
| Age
| ETag
| Location
| Proxy-Authenticate
| Retry-After
| Server
| Vary
| WWW-Authenticate
Entity
Request and Response messages MAY transfer an entity if not otherwise restricted by the request method or response status code
An entity consists of entity-header fields and an entity-body, although some responses will only include the entity-headers
Entity Header Fields
Entity-header fields define metainformation about the entity-body or, if no body is present, about the resource identified by the request
entity-header = Allow
| Content-Encoding
| Content-Language
| Content-Length
| Content-Location
| Content-MD5
| Content-Range
| Content-Type
| Expires
| Last-Modified
| extension-header
extension-header = message-header
Entity Body
The entity-body (if any) sent with an HTTP request or response is in a format and encoding defined by the entity-header fields
entity-body = *OCTET
An entity-body is only present in a message when a message-body is present
When an entity-body is included with a message, the data type of that body is determined via the header fields Content-Type and Content- Encoding
These define a two-layer, ordered encoding model:
entity-body := Content-Encoding( Content-Type( data ) )
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body
If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource
If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream"
The entity-length of a message is the length of the message-body before any transfer-codings have been applied
Examples
Request = Request-Line
*(( general-header
| request-header
| entity-header ) CRLF)
CRLF
[ message-body ]
Request-Line
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
An example Request-Line would be:
GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
The Method token indicates the method to be performed on the resource identified by the Request-URI
The method is case-sensitive
Method = "OPTIONS"
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "TRACE"
| "CONNECT"
| extension-method
extension-method = token
The methods GET and HEAD MUST be supported by all general-purpose servers. All other methods are OPTIONAL
An origin server SHOULD return the status code 405 (Method Not Allowed) if the method is known by the origin server but not allowed for the requested resource, and 501 (Not Implemented) if the method is unrecognized or not implemented by the origin server
Request-URI = "*" | absoluteURI | abs_path | authority
The asterisk "*" means that the request does not apply to a particular resource, but to the server itself, and is only allowed when the method used does not necessarily apply to a resource
The Resource Identified by a Request
The exact resource identified by an Internet request is determined by examining both the Request-URI and the Host header field
1. If Request-URI is an absoluteURI, the host is part of the Request-URI. Any Host header field value in the request MUST be ignored.
2. If the Request-URI is not an absoluteURI, and the request includes a Host header field, the host is determined by the Host header field value.
3. If the host as determined by rule 1 or 2 is not a valid host on the server, the response MUST be a 400 (Bad Request) error message.
Request Header Fields
request-header = Accept
| Accept-Charset
| Accept-Encoding
| Accept-Language
| Authorization
| Expect
| From
| Host
| If-Match
| If-Modified-Since
| If-None-Match
| If-Range
| If-Unmodified-Since
| Max-Forwards
| Proxy-Authorization
| Range
| Referer
| TE
| User-Agent
| Range
| Referer
| TE
| User-Agent
New or experimental header fields MAY be given the semantics of request- header fields if all parties in the communication recognize them to be request-header fields
Unrecognized header fields are treated as entity-header fields
Response
Response = Status-Line
*(( general-header
| response-header
| entity-header ) CRLF)
CRLF
[ message-body ]
Status-Line
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
The first digit of the Status-Code defines the class of response
There are 5 values for the first digit:
- 1xx: Informational - Request received, continuing process
- 2xx: Success - The action was successfully received,
understood, and accepted
- 3xx: Redirection - Further action must be taken in order to
complete the request
- 4xx: Client Error - The request contains bad syntax or cannot
be fulfilled
- 5xx: Server Error - The server failed to fulfill an apparently
valid request
Status-Code =
"100" ; Continue
| "101" ; Switching Protocols
| "200" ; OK
| "201" ; Created
| "202" ; Accepted
| "203" ; Non-Authoritative Information
| "204" ; No Content
| "205" ; Reset Content
| "206" ; Partial Content
| "300" ; Multiple Choices
| "301" ; Moved Permanently
| "302" ; Found
| "303" ; See Other
| "304" ; Not Modified
| "305" ; Use Proxy
| "307" ; Temporary Redirect
| "400" ; Bad Request
| "401" ; Unauthorized
| "402" ; Payment Required
| "403" ; Forbidden
| "404" ; Not Found
| "405" ; Method Not Allowed
| "406" ; Not Acceptable
| "407" ; Proxy Authentication Required
| "408" ; Request Time-out
| "409" ; Conflict
| "410" ; Gone
| "411" ; Length Required
| "412" ; Precondition Failed
| "413" ; Request Entity Too Large
| "414" ; Request-URI Too Large
| "415" ; Unsupported Media Type
| "416" ; Requested range not satisfiable
| "417" ; Expectation Failed
| "500" ; Internal Server Error
| "501" ; Not Implemented
| "502" ; Bad Gateway
| "503" ; Service Unavailable
| "504" ; Gateway Time-out
| "505" ; HTTP Version not supported
| extension-code
extension-code = 3DIGIT
Reason-Phrase = *<TEXT, excluding CR, LF>
pplications MUST understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response MUST NOT be cached
Response Header Fields
response-header = Accept-Ranges
| Age
| ETag
| Location
| Proxy-Authenticate
| Retry-After
| Server
| Vary
| WWW-Authenticate
Entity
Request and Response messages MAY transfer an entity if not otherwise restricted by the request method or response status code
An entity consists of entity-header fields and an entity-body, although some responses will only include the entity-headers
Entity Header Fields
Entity-header fields define metainformation about the entity-body or, if no body is present, about the resource identified by the request
entity-header = Allow
| Content-Encoding
| Content-Language
| Content-Length
| Content-Location
| Content-MD5
| Content-Range
| Content-Type
| Expires
| Last-Modified
| extension-header
extension-header = message-header
Entity Body
The entity-body (if any) sent with an HTTP request or response is in a format and encoding defined by the entity-header fields
entity-body = *OCTET
An entity-body is only present in a message when a message-body is present
When an entity-body is included with a message, the data type of that body is determined via the header fields Content-Type and Content- Encoding
These define a two-layer, ordered encoding model:
entity-body := Content-Encoding( Content-Type( data ) )
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body
If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource
If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream"
The entity-length of a message is the length of the message-body before any transfer-codings have been applied
Examples
D:\projects\maui>curl -I www.g.cn HTTP/1.1 301 Moved Permanently Location: http://www.google.cn/webhp?source=g_cn Content-Type: text/html; charset=UTF-8 Date: Fri, 26 Dec 2008 05:07:21 GMT Expires: Sun, 25 Jan 2009 05:07:20 GMT Cache-Control: public, max-age=2592000 Server: gws Content-Length: 0 D:\projects\maui>curl -I www.google.cn HTTP/1.1 200 OK Cache-Control: private, max-age=0 Date: Fri, 26 Dec 2008 05:07:28 GMT Expires: -1 Content-Type: text/html; charset=GB2312 Set-Cookie: PREF=ID=fc9dd9293e07dfbd:NW=1:TM=1230268048:LM=1230268048:S=GSJ0ovAC pSDvYdtq; expires=Sun, 26-Dec-2010 05:07:28 GMT; path=/; domain=.google.cn Server: gws Content-Length: 0 D:\projects\maui>curl -I 192.168.0.5 HTTP/1.1 302 Found Content-Type: text/html; charset=utf-8 Set-Cookie: _freewheel_session_id=6f190d42bf361e23336c7b646a565c2d; path=/; Http Only Location: http://192.168.0.5/system/account/login Cache-Control: no-cache Content-Length: 105 Date: Fri, 26 Dec 2008 05:27:16 GMT Server: lighttpd/1.4.19
发表评论
-
leveldb资料整理
2011-12-28 19:50 10670leveldb介绍 http://code.google.co ... -
HTTP Basic/Digest Authentication、OAuth
2009-01-09 14:01 9571HTTP Authentication au ... -
HTTP1.1 Notes 8, Header Field Definitions
2008-12-31 13:13 4420http://www.w3.org/Protocols/rfc ... -
HTTP1.1 Notes 7, Status Code Definitions
2008-12-30 15:01 3270Informational 1xx This class of ... -
HTTP1.1 Notes 6, Method Definitions
2008-12-30 12:30 2462Safe and Idempotent Methods In ... -
HTTP1.1 Notes 5, Connections
2008-12-29 13:25 2694Persistent Connections advantag ... -
HTTP1.1 Notes 3, HTTP Message
2008-12-26 10:57 4167Message Types HTTP-mess ... -
HTTP1.1 Notes 2, Protocol Parameters
2008-12-24 13:12 2677HTTP Version HTTP-Versio ... -
HTTP1.1 Notes 1, Terminology & ABNF
2008-12-23 17:03 2794http://www.w3.org/Protocols/rfc ... -
以后都用MindManager做年度总结和年度计划
2008-12-19 19:54 59842008总结如下: 2009计划如下: 希望自己能够戒骄 ... -
Skip List 跳表
2008-12-19 15:54 5523跳表是个概率性的的数据结构,由William Pugh在199 ... -
数据仓库toolkit笔记1,Dimensional Modeling Primer
2008-12-15 18:49 2384数据仓库管理员的主要职责: 1,通过业务领域、工作职责和计算机 ... -
CLRS笔记15,动态规划
2008-12-10 18:14 1849动态规划算法的实质是分治思想和解决冗余,因此,动态规划是一种将 ... -
Web搜索引擎原理和技术
2008-12-08 12:06 4804主要的三个功能模块: ... -
CLRS笔记12,二叉查找树/红黑树
2008-12-04 17:32 2795二叉查找树 二叉查找树是一颗二叉树,并且每个节点x的左子树中所 ... -
CLRS笔记11,Hash Table
2008-12-03 15:02 1979Hash Table是实现动态集合在O(1)时间内的INSER ... -
CLRS笔记10、基本数据结构
2008-11-28 14:28 1881数学中的集合是不变的 ... -
CLRS笔记8,线性时间排序(counting、radix、bucket sort)
2008-11-27 11:13 3457线性时间排序即时间复杂度为Θ(n)的排序,主要有计数排序、基数 ... -
How to be Computer Game Developer?
2008-07-21 13:35 1240http://www.beyondrails.com/blog ... -
游戏引擎剖析
2008-07-21 11:59 2368转载一篇《游戏引擎剖析》系列,了解游戏引擎开发相关的知识。 ...
相关推荐
自留demo。springMVC-HttpEntity(ResponseEntity)与jQuery交互的小结demo。
Http1.1超文本传输协议中文版,目录如下: 1 引论 7 1.1 目的 7 1.2 要求 8 1.3 术语 8 1.4 总体操作 12 2 符号习惯和一般语法 13 2.1 扩充的BNF(扩充的 巴科斯-诺尔范式) 14 2.2基本规则 (basic rule) 15 3 ...
git首次提交代码到远程仓库提示413错误,...Delta compression using up to 4 threads Compressing objects: 100% (133/133), done. error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Req
Entity Framework的全称是ADO.NET Entity Framework,是微软开发的基于ADO.NET的ORM(Object/Relational Mapping)框架。 Entity Framework的主要特点: 1. 支持多种数据库(Microsoft SQL Server, Oracle, and DB2)...
解决java中的中文乱码。不需要那么多废话,但是字数不够,没办法。
import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.scheme.Scheme; ...
今天遇到一个问题,在PHP程序中上传图片出现了以下错误:HTTP:413 Request Entity Too Large。 开发环境:CentOS + Nginx + PHP + MySql 解决方案 解决此问题,根据上传数据文件的大小,需要调节PHP和Nginx相关的...
ADO.NET 3.5高级编程--应用LINQ & Entity Framework 整书的实例源码
电子书 Entity Framework 4 In Action
request.getRequestDispatcher("/admin/register.jsp").forward(request,response); return; } //2.调用业务层完成注册操作并返回结果 User user = new User(userId,realName,pwd,age, Arrays.toString...
上传图片的时候,是用laravel自带的上传图片的方法,一下气上传了20张,结果就无情报错:413 Request Entity Too Large,后面查一下,这个报错信息是nginx报的错误,不是php报的错误。也就是说在上传图片的时候被...
org.apache.http.entity.mime apache的android jar包
Entity Framework 4 In Action Source Code
在用 phpMyAdmin 进行 sql 数据库导入的时候,经常需要上传比较大的 sql 数据文件,而这时会常碰见 nginx报错:413 Request Entity Too Large。解决此问题,根据上传数据文件的大小进行修改处理
Entity.Framework.4.in.Action 挺适合快速学习EF
安卓开发类库和jar包httpmime-4.1.2.jar org.apache.http.entity.mime
Within days of an announcement, news articles criticizing an entity’s response can negatively influence public opinion. Sizable data breaches elicit scrutiny that can last for years. Target became a...
Entity Framework 6 Recipes Entity Framework 6 Recipes
> GET /person HTTP/1.1 > User-Agent: curl/7.30.0 > Host: localhost:8080 > Accept: * / * > < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < X-Protobuf-Schema: src/main/proto/tutorial/...