1. Type of frame:
In the binary frame structure, the head has 8 bytes (64Bit), which has one byte (8Bit) to mark the type of frame:
HTTP2.0 Specifies the following frame types:
DATA: For transmitting HTTP message body headers: The user transmits additional header fields about the stream priority: the user specifies or re-specifies the precedence of the reference resource rst_string: abnormal termination for notification flow settings: Data configuration for notifying both ends of communication push_promise: used to emit an offer to create a stream and a server reference resource ping: used to calculate round-trip time, perform an "activity" check Goaway: Used to notify the peer to stop creating flow window_update on the current connection: used to implement traffic control for individual streams or individual connections continuation: For continuing a series of header block fragments
1.1 Creating a new stream
The client creates a new stream by sending a headers frame that contains a public header with a new stream ID, an optional 31-bit priority, and a set of HTTP key-value pairs headers.
The server initiates a push stream by sending a push_promise frame, which is equivalent to the headers frame, but it contains an "offer flow ID" with no precedence.
Note: Because the metadata for the stream is sent separately from the app data, the client and server can prioritize them differently. For example, the flow priority of flow control can be higher,
But only apply it to the data frame
1.2 Sending Application Data
After creating a new stream and sending an HTTP header, the next step is to send the application data using the data frame. The application data can be divided into multiple data frames, and the last frame flips the header's End_stream field.
HTTP2.0 Binary Sub-frame