TCP / IP (Application Layer)

1.HTTP Introduction
Reference Links

https://www.cnblogs.com/gofighting/p/5421890.html

HTTP1.0 and HTTP1.1
HTTP currently three versions: HTTP0.9, HTTP1.0, HTTP1.1
HTTP1.0 the most widely used,
HTTP1.1 adds a number of header fields, and part of the definition were 1.0 Supplement .

HTTP1.0 and the difference HTTP1.1
1, HTTP1.1 supports long connections and pipelining requests

HTTP1.0 provisions of the browser and server to maintain only brief connection , the browser on each request needs to establish a TCP connection with the server, the TCP connection is disconnected immediately after the completion of the request processing server, the server does not track each customer record in the past requests.

HTTP 1.1 persistent connections supports ** ** Persistent Connection, and default persistent connection. In the same connection may be transmitted in a tcp plurality of HTTP requests and responses. A plurality of requests and responses may overlap, simultaneous multiple requests and responses a more and more request headers and response headers (such as host HTTP1.0 no field).
in the embodiment 1.0 the session:
1. establish a connection
2. the request message
3. echo response messages
4. Turn off the connection

HTTP1.1 persistent connection, the need to add new head request help achieve, for example, when the value of Keep-Alive Connection request header, the server notifies the client returns the result of this request to maintain the connection; Connection request header is close , the server notifies the client returns this request to close the connection after the results.
HTTP1.1 also provides related authentication, and state management Cache caching mechanism of request headers and response headers.

2.HTTP 1.1 increase host field
believe that bind each server a unique IP address, therefore, request URL in the message did not get through the host name (hostname) in the HTTP1.0. But with the development of virtual mainframe technology, there can be multiple virtual hosts (Multi-homed Web Servers) on a single physical server, and they share a single IP address.
HTTP1.1 request and response messages should support Host header field, and the request message if no Host header field report an error (400 Bad Request). In addition, the server should accept the resource request with an absolute path marked.

3,100 (Continue) Status (conserve bandwidth)
the HTTP / 1.1 added a new status code 100 (the Continue). The client sent in advance a only lead field of the request, if the server because permission denied request, returning a response code 401 (Unauthorized); If the server receives this request is sent back in response code 100, the client may continue to send a complete request with an entity a. Use 100 (Continue) status code, allows a client to send a message body before the request first with a request header to test the server, see the server receives the request body or not, and then decide whether or not to send request body.
HTTP status codes
used to represent three-digit code of the HTTP response status page:
for example, 101, 102 (1.1 began); 200, 201; 301, 302;

Write pictures described here

301 permanent orientation of
302 temporary redirect
304 client has performed a GET, but the file does not change

Guess you like

Origin blog.csdn.net/alexhu2010q/article/details/80888561