HTTP protocol Hypertext Transfer Protocol
HTTP protocol is the iOS seven Layer protocol application layer, is based on the TCP/IP protocol, why more than one protocol, in fact, the use of TCP protocol is also possible, but the TCP three handshake is always kept connected, if only the C/S design can be TCP can be, Because of this setting, such as Memcache in the client and server connection, the number of connections is thousands of, but the B/s setting at the same time the connection is hundreds of thousands of or more, for the server is overloaded, so the use of the HTTP protocol, each connection after the disconnection, such as refreshing a webpage, each request is independent, So the HTTP protocol is stateless.
HTTP protocol is a reliable connection based on TCP, the popular point is that after the request, the server side immediately shut down the connection, release resources, so as to ensure that the resources available, but also absorb the advantages of TCP reliability.
Each HTTP request has 3 pieces of content
1. Request Line get Post
2. Requested header information
3, the content of the request
There are 3 messages at the time of the response
1, response line 200 404
2, Response header header (") so the header cannot have content
3. Response Content
http1.1 and http1.0 differences
1. One TCP can send multiple HTTP requests and responses
2. Multiple request and response processes can overlap
3, add more request head and response head,
Web HTTP protocol