Http协议学习资料

RFCS

https://www.w3.org/Protocols/rfc2616/rfc2616.html

http1.0: http://www.ietf.org/rfc/rfc1945.txt

http1.1: http://www.ietf.org/rfc/rfc2616.txt

https://tools.ietf.org/html/rfc7230

RFC - Draft Standard (June 1999; Errata)

Obsoleted by RFC 7231, RFC 7230, RFC 7233, RFC 7232, RFC 7234, RFC 7235

Updated by RFC 5785, RFC 6585, RFC 6266, RFC 2817

Obsoletes RFC 2068

 

http2:

https://http2.github.io/

http://httpwg.org/specs/rfc7540.html

http://httpwg.org/specs/rfc7541.html

cookie:

HTTP State Management Mechanism:http://www.ietf.org/rfc/rfc2109.txt

 

Methods

   +---------+------+------------+---------------+

   | Method  | Safe | Idempotent | Reference     |

   +---------+------+------------+---------------+

   | CONNECT | no   | no         | Section 4.3.6 |

   | DELETE  | no   | yes        | Section 4.3.5 |

   | GET     | yes  | yes        | Section 4.3.1 |

   | HEAD    | yes  | yes        | Section 4.3.2 |

   | OPTIONS | yes  | yes        | Section 4.3.7 |

   | POST    | no   | no         | Section 4.3.3 |

   | PUT     | no   | yes        | Section 4.3.4 |

   | TRACE   | yes  | yes        | Section 4.3.8 |

   +---------+------+------------+———————+

response codes:

   +------+-------------------------------+--------------------------+

   | Code | Reason-Phrase                 | Defined in...            |

   +------+-------------------------------+--------------------------+

   | 100  | Continue                      | Section 6.2.1            |

   | 101  | Switching Protocols           | Section 6.2.2            |

   | 200  | OK                            | Section 6.3.1            |

   | 201  | Created                       | Section 6.3.2            |

   | 202  | Accepted                      | Section 6.3.3            |

   | 203  | Non-Authoritative Information | Section 6.3.4            |

   | 204  | No Content                    | Section 6.3.5            |

   | 205  | Reset Content                 | Section 6.3.6            |

   | 206  | Partial Content               | Section 4.1 of [RFC7233] |

   | 300  | Multiple Choices              | Section 6.4.1            |

   | 301  | Moved Permanently             | Section 6.4.2            |

   | 302  | Found                         | Section 6.4.3            |

   | 303  | See Other                     | Section 6.4.4            |

   | 304  | Not Modified                  | Section 4.1 of [RFC7232] |

   | 305  | Use Proxy                     | Section 6.4.5            |

   | 307  | Temporary Redirect            | Section 6.4.7            |

   | 400  | Bad Request                   | Section 6.5.1            |

   | 401  | Unauthorized                  | Section 3.1 of [RFC7235] |

   | 402  | Payment Required              | Section 6.5.2            |

   | 403  | Forbidden                     | Section 6.5.3            |

   | 404  | Not Found                     | Section 6.5.4            |

   | 405  | Method Not Allowed            | Section 6.5.5            |

   | 406  | Not Acceptable                | Section 6.5.6            |

   | 407  | Proxy Authentication Required | Section 3.2 of [RFC7235] |

   | 408  | Request Timeout               | Section 6.5.7            |

   | 409  | Conflict                      | Section 6.5.8            |

   | 410  | Gone                          | Section 6.5.9            |

   | 411  | Length Required               | Section 6.5.10           |

   | 412  | Precondition Failed           | Section 4.2 of [RFC7232] |

   | 413  | Payload Too Large             | Section 6.5.11           |

   | 414  | URI Too Long                  | Section 6.5.12           |

   | 415  | Unsupported Media Type        | Section 6.5.13           |

   | 416  | Range Not Satisfiable         | Section 4.4 of [RFC7233] |

   | 417  | Expectation Failed            | Section 6.5.14           |

   | 426  | Upgrade Required              | Section 6.5.15           |

   | 500  | Internal Server Error         | Section 6.6.1            |

   | 501  | Not Implemented               | Section 6.6.2            |

   | 502  | Bad Gateway                   | Section 6.6.3            |

   | 503  | Service Unavailable           | Section 6.6.4            |

   | 504  | Gateway Timeout               | Section 6.6.5            |

   | 505  | HTTP Version Not Supported    | Section 6.6.6            |

   +------+-------------------------------+—————————————+

Headers

+-------------------+----------+----------+-----------------+

   | Header Field Name | Protocol | Status   | Reference       |

   +-------------------+----------+----------+-----------------+

   | Accept            | http     | standard | Section 5.3.2   |

   | Accept-Charset    | http     | standard | Section 5.3.3   |

   | Accept-Encoding   | http     | standard | Section 5.3.4   |

   | Accept-Language   | http     | standard | Section 5.3.5   |

   | Allow             | http     | standard | Section 7.4.1   |

   | Content-Encoding  | http     | standard | Section 3.1.2.2 |

   | Content-Language  | http     | standard | Section 3.1.3.2 |

   | Content-Location  | http     | standard | Section 3.1.4.2 |

   | Content-Type      | http     | standard | Section 3.1.1.5 |

   | Date              | http     | standard | Section 7.1.1.2 |

   | Expect            | http     | standard | Section 5.1.1   |

   | From              | http     | standard | Section 5.5.1   |

   | Location          | http     | standard | Section 7.1.2   |

   | Max-Forwards      | http     | standard | Section 5.1.2   |

   | MIME-Version      | http     | standard | Appendix A.1    |

   | Referer           | http     | standard | Section 5.5.2   |

   | Retry-After       | http     | standard | Section 7.1.3   |

   | Server            | http     | standard | Section 7.4.2   |

   | User-Agent        | http     | standard | Section 5.5.3   |

   | Vary              | http     | standard | Section 7.1.4   |

   +-------------------+----------+----------+-----------------+

 

Cookies

https://datatracker.ietf.org/doc/rfc7234/?include_text=1

Cookie:

set-cookie      =       "Set-Cookie:" cookies

   cookies         =       1#cookie

   cookie          =       NAME "=" VALUE *(";" cookie-av)

   NAME            =       attr

   VALUE           =       value

   cookie-av       =       "Comment" "=" value

                   |       "Domain" "=" value

                   |       "Max-Age" "=" value

                   |       "Path" "=" value

                   |       "Secure"

                   |       "Version" "=" 1*DIGIT

   +------------------------+----------------------------------+

   | Cache Directive        | Reference                        |

   +------------------------+----------------------------------+

   | max-age                | Section 5.2.1.1, Section 5.2.2.8 |

   | max-stale              | Section 5.2.1.2                  |

   | min-fresh              | Section 5.2.1.3                  |

   | must-revalidate        | Section 5.2.2.1                  |

   | no-cache               | Section 5.2.1.4, Section 5.2.2.2 |

   | no-store               | Section 5.2.1.5, Section 5.2.2.3 |

   | no-transform           | Section 5.2.1.6, Section 5.2.2.4 |

   | only-if-cached         | Section 5.2.1.7                  |

   | private                | Section 5.2.2.6                  |

   | proxy-revalidate       | Section 5.2.2.7                  |

   | public                 | Section 5.2.2.5                  |

   | s-maxage               | Section 5.2.2.9                  |

   | stale-if-error         | [RFC5861], Section 4             |

   | stale-while-revalidate | [RFC5861], Section 3             |

   +------------------------+----------------------------------+

 

HTTP1.1和HTTP1.0的区别

http://blog.csdn.net/codenerd/article/details/4222594

 

1.1 新特性

  1. keep-alive
  2. chunk 编码
    size\r\n
    Size of contents
    1D\r\n
    I’m as helpless as a kitten u
    9\r\n
    P a tree.
    0\r\n
  3. transfer-encoding

Authentication

https://datatracker.ietf.org/doc/rfc7235/

 

   +---------------------+--------------------------+

   | Header Field Name   | Defined in...            |

   +---------------------+--------------------------+

   | Authorization       | Section 4.2 of [RFC7235] |

   | Proxy-Authorization | Section 4.4 of [RFC7235] |

   +---------------------+--------------------------+

Post Form

form uploads:

enc-type:

application/x-www-form-urlencoded

multipart/form-data:

text/plain:

https://www.cnblogs.com/hua2015/p/5066247.html

 

GET Max url size:

nginx: 4k

apache: 8k

https://www.cnblogs.com/cuihongyu3503319/p/5892257.html

 

HTTP:

https://www.cnblogs.com/li0803/archive/2008/11/03/1324746.html

 

https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Connector_Comparison

http://www.jianshu.com/p/806918ee137e

References

http2 demo sites
http://www.http2demo.io/
https://http2.akamai.com/demo
https://http2.golang.org/
tools
https://blog.cloudflare.com/tools-for-debugging-testing-and-using-http-2/
h2c
https://github.com/fstab/h2c

你可能感兴趣的:(Http协议,Http)