HTTP protocol Study and Review

The answer comes from the "HTTP Definitive Guide," there is no explanation of the term, not to learn to explain, first stood, watching the HTTP network diagram this one to end it

Why use TCP as the transport layer protocol HTTP?

  • To ensure error-free data transmission (and inspection, the ACK acknowledgment, retransmission)
  • Arrival order can ensure that data (packet number, retransmission)
  • Unsegmented data stream, the data may be sent at any time an arbitrary size (do not know)

 

HTTP1.0 / 1.1 / 2.0 difference?

1.0->1.1

  • Long connection, Header-> Keep-Alive
  • And thanks to the long connection request may be pipelined (request the page data comprises a plurality of sequentially returned, request queue into the response queue), or in fact by sending a request to resolve a plurality of TCP
  • Caching, Header-> Cache-Control Comments: https: //www.cnblogs.com/chenqf/p/6386163.html
  • HTTP, Header-> Range, specify the offset
  • Header-> host, multiple domain names can belong to the same server

 

1.1 -> 2.0 New Features

  • Binary framing
  • Multiplexer
  • Header compression
  • Server push

 

TCP three-way handshake with the four waving process, to be able to dictation

 

 

HTTP request TCP connection is disconnected decide which party is determined by what?

HTTP1.0

Response packet containing the content-length, active client to disconnect, or after completion of active server sends the disconnect

HTTP1.1/2.0

Response packet containing the content-length, client interrupts

Response packet containing Transfer-encoding: chunked body fragment, the fragment length is identified, the client can be actively turned off

We are not, after the server has been sent off initiative

 

Header Is there anything useful parameters?

Management range is divided according to different generic, request, response, body, extended Header (available their definition)

 

General Header

 

 

 Request Header

 

 

In response Header

 

  • Subject Header

What, what's the point HTTP response status code there?

  • 100-101 Information Tips

100 Continue meaning of existence is more like an optimization, client first

Expect: 100-continue

The Header is sent to the server, if the server sends a 100 Continue response, the client will continue to transmit the contents of the Body.

200-206 success

 

300-305 重定向

 

400-415 客户端错误

 

 

500-505 服务端错误

 

POST,GET的区别,还有什么其他的方法呢?

其实语义化的理解,GET是从服务器获取数据,POST是插入数据,带着这个区理解下面的区别

GET后退按钮/刷新无害,POST数据会被重新提交(浏览器应该告知用户数据会被重新提交)。
GET书签可收藏,POST为书签不可收藏。
GET能被缓存,POST不能缓存 。
GET编码类型application/x-www-form-url,POST编码类型encodedapplication/x-www-form-urlencoded 或 multipart/form-data。为二进制数据使用多重编码。
GET历史参数保留在浏览器历史中。POST参数不会保存在浏览器历史中。
GET对数据长度有限制,当发送数据时,GET 方法向 URL 添加数据;URL 的长度是受限制的(URL 的最大长度是 2048 个字符)。POST无限制。
GET只允许 ASCII 字符。POST没有限制。也允许二进制数据。
与 POST 相比,GET 的安全性较差,因为所发送的数据是 URL 的一部分。在发送密码或其他敏感信息时绝不要使用 GET !POST 比 GET 更安全,因为参数不会被保存在浏览器历史或 web 服务器日志中。
 
注意:方法是可以扩展的
 

 

Guess you like

Origin www.cnblogs.com/haon/p/11002888.html