Home > other >  Http technology seminar
Http technology seminar

Time:09-16

Summary of 1
1.1 define
The HTTP Protocol is a HyperText Transfer Protocol (HyperText Transfer Protocol), is an application layer Protocol, consists of the request and response, the client server model is a standard, HTTP is a stateless Protocol, is used to distribute, collaboration HyperText information systems,
Version 1.2
At present there are mainly Http1.0 Http1.1, Http2.0 version, Http3.0 version is in draft state,
1.3 standard
By the World Wide Web Consortium (W3C) and the Internet Engineering Task Force (IETF) jointly issued a series of RFC, RFC 1945 defines HTTP/1.0 version, is one of the most famous RFC 2616, RFC 2616 defines a version of the widely used today - HTTP 1.1,
1.4 other

2 protocol specification
2.1 the agreement content
HTTP Version 2.1.1 Version (HTTP)
HTTP using master-slave (& lt; Major> . & lt; Minor>) Digital form to represent the version, for example, 1.0, 1.1, 20,
2.1.2 uniform resource identifier

2.1.3 Connection
The actual circulation of a transport layer, it is based on two mutual communication between applications,
In http1.1, request and reponse header is likely a connection, the meaning of this header is when the client and server communication long links on how to do,
In http1.1, client and server are the default party support long link, if the client use http1.1 agreement, but does not want to use the long link, you will need to indicate the connection in the header of the value of the close; Don't want to support long link if the server side, it also needs to be specified in the response values for the close connection, regardless of the request or response header contains the value for the close connection, indicate that currently in use TCP link after the request processing will be broken in the day, when the client requests for new again after we must create a new TCP connection,
2.1.4 Message: the Message
The basic unit of the HTTP communication, including a structured sequence and transmitted by connecting eight yuan group,
2.1.5 Request: Request
A request from the client to the server information including method is applied to the resource, resource identifier and protocol version number,
2.1.6 Response: the Response
A returned from the server information including the HTTP protocol version number, the state of the request (such as "success" or "not found"), and documentation of the MIME type,
2.1.7 resources: the Resource
By the URI identifies network data object, or service,
2.1.8 Entity: the Entity
Data resources, or from the service resource consumers a special representation method, it can be surrounded in a request or response message, an entity including physical header information and contents of entity itself,
2.1.9 Client: Client
A while establishing a connection for the purposes of sending a request application,
2.1.10 user agent: UserAgent
Initialize a request of the client, they are browser, editor, or other user tools,
2.1.11 Server: Server
A request to accept connections and return the application of information,
2.1.12 source server: Originserver
Is a given resource can reside or are created on the server,
2.1.13 agent: Proxy
An intermediate process, it can act as a server, can also act as a client, for other client request, the request is through possible translation internally or through transfer to other server, an agent before sending a request information, must explain and if possible to rewrite it,
Often acting as a client side through a firewall gateway, the agent also can be applied as a help to through the protocol processing is not the user agent to complete the request,

2.1.14 Gateway: Gateway
A server as the medium of other servers, and proxy, gateway to accept the request as it is the source for the requested resource. The requesting client didn't realize that in dealing with the gateway,
Often as a gateway through a firewall on the server side of the portal, the gateway can also the translator as an agreement in order to access those stored in the HTTP resource in the system,
2.1.15 channels: Tunnel
As two connection relay mediation procedure, once activated, the channel is considered do not belong to the HTTP communication, although the channel may be initialized by the an HTTP request, when the relay is closed on both ends of the connection, channel disappears, when a Portal (Portal) must be present or Intermediary (Intermediary) cannot explain the relay communication channel is often used,
2.1.16 Cache: Cache
Response information is stored in the local area,
2.2 HTTP status code
Returns the result of a status code
1 xx said server has been receiving a client request, the client may continue to send the request
2 xx normal request processed

3 xx need for additional operation to complete the request
4 xx said the client's request with illegal content
5 xx server error processing request

2.3 the HTTP request method
Methods that support version
GET access to resources 1.0, 1.1, 2.0, 3.0
POST transport entity body 1.0, 1.1, 2.0, 3.0
PUT transfer files 1.0, 1.1, 2.0, 3.0
The HEAD to get a message first 1.0, 1.1, 2.0, 3.0
DELETE DELETE files 1.0, 1.1, 2.0, 3.0
OPTIONS to ask support method 1.0, 1.1, 2.0, 3.0
TRACE tracking path 1.1, 2.0, 3.0
The CONNECT request with tunnel protocol connection broker 1.1, 2.0, 3.0
The LINK establishment and the connection between the resources 1.0
Disconnected UNLINK relationship 1.0


3 protocol implementation
3.1 choose
3.2 implementation mechanism
3.2.1 request response model
HTTP protocol was started by the client request, the server back to send response, see below:

This will limit the use of the HTTP protocol to realize at the time of the client without a request, the server will be pushed to the client,
HTTP is a stateless protocol, the request and the last of the same clients is no corresponding relation,
3.2.2 workflow
A HTTP operations is called a transaction, its working process can be divided into four steps:
1) the first client and server need to establish a connection,
2) after the connection is established, the client sends a request to the server, the request of format for: uniform resource identifier (URL), protocol version number, is behind the MIME information including request modifiers, client information and the possible content,
3) after the server receives the request, and give corresponding response information, its format is a status line, including the protocol version number information, a success or error code that is behind the MIME information including servers, entity information and possible content,
4) the information returned by the client receiving the server through the browser to display in the user's screen, and then disconnect the client and server,
If a step in the process of the above errors, then an error message will be returned to the client,
3.3 HTTP/2.0 improve
? Multiplexing
HTTP/2.0 using multiplexing, one TCP connection can handle multiple requests,
? The first compression
HTTP/1.1 first with a lot of information, and each time repeat to send, HTTP/2.0 requires communication each cache a copy of the first field, so as to avoid the repeated transmission,
? The service side push
HTTP/2.0, when a client requests a resource, the related resources together to send to the client, the client won't need to initiate the request again, such as the client request index. The HTML page, the server is the index. The js together sent to the client,
? Binary format
HTTP/1.1 analysis is based on the text, and HTTP/2.0 USES binary format,
HTTP/3.0 3.4 version of the improved
? To reduce the TCP three-way handshake and TLS handshake time
? Improve the congestion control of
? Avoid team head block multiplexing
? Connection migration
? Forward error correction
3.5 the Apache Http Client and Apache Http Core version 5
The Apache Http Client version 5 will support http2.0 agreement
  • Related