- class QHttp2Configuration¶
The
QHttp2Configuration
class controls HTTP/2 parameters and settings. More…Synopsis¶
Methods¶
def
__init__()
def
maxFrameSize()
def
__ne__()
def
__eq__()
def
swap()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
QHttp2Configuration
controls HTTP/2 parameters and settings thatQNetworkAccessManager
will use to send requests and process responses when the HTTP/2 protocol is enabled.The HTTP/2 parameters that
QHttp2Configuration
currently supports include:The session window size for connection-level flow control. Will be sent to a remote peer when needed as ‘WINDOW_UPDATE’ frames on the stream with an identifier 0.
The stream receiving window size for stream-level flow control. Sent as ‘SETTINGS_INITIAL_WINDOW_SIZE’ parameter in the initial SETTINGS frame and, when needed, ‘WINDOW_UPDATE’ frames will be sent on streams that
QNetworkAccessManager
opens.The maximum frame size. This parameter limits the maximum payload a frame coming from the remote peer can have. Sent by
QNetworkAccessManager
as ‘SETTINGS_MAX_FRAME_SIZE’ parameter in the initial ‘SETTINGS’ frame.The server push. Allows to enable or disable server push. Sent as ‘SETTINGS_ENABLE_PUSH’ parameter in the initial ‘SETTINGS’ frame.
The
QHttp2Configuration
class also controls if the header compression algorithm (HPACK) is additionally using Huffman coding for string compression.Note
The configuration must be set before the first request was sent to a given host (and thus an HTTP/2 session established).
Note
Details about flow control, server push and ‘SETTINGS’ can be found in RFC 7540 . Different modes and parameters of the HPACK compression algorithm are described in RFC 7541 .
- __init__()¶
Default constructs a
QHttp2Configuration
object.Such a configuration has the following values:
Server push is disabled
Huffman string compression is enabled
Window size for connection-level flow control is 65535 octets
Window size for stream-level flow control is 65535 octets
Frame size is 16384 octets
- __init__(other)
- Parameters:
other –
QHttp2Configuration
Copy-constructs this
QHttp2Configuration
.- huffmanCompressionEnabled()¶
- Return type:
bool
Returns
true
if the Huffman coding in HPACK is enabled.See also
- maxFrameSize()¶
- Return type:
int
Returns the maximum payload size that HTTP/2 frames can have. The default (initial) value is 16384 octets.
See also
- __ne__(rhs)¶
- Parameters:
rhs –
QHttp2Configuration
- Return type:
bool
Returns
true
iflhs
andrhs
do not have the same set of HTTP/2 parameters.- __eq__(rhs)¶
- Parameters:
rhs –
QHttp2Configuration
- Return type:
bool
Returns
true
iflhs
andrhs
have the same set of HTTP/2 parameters.- serverPushEnabled()¶
- Return type:
bool
Returns true if server push was enabled.
- sessionReceiveWindowSize()¶
- Return type:
int
Returns the window size for connection-level flow control. The default value
QNetworkAccessManager
will be using is 2147483647 octets.See also
- setHuffmanCompressionEnabled(enable)¶
- Parameters:
enable – bool
If
enable
istrue
, HPACK compression will additionally compress string using the Huffman coding. Enabled by default.- setMaxFrameSize(size)¶
- Parameters:
size – int
- Return type:
bool
Sets the maximum frame size that
QNetworkAccessManager
will advertise to the server when sending its initial SETTINGS frame.Note
While this
size
is required to be within a range between 16384 and 16777215 inclusive, the actual payload size in frames that carry payload maybe be less than 16384.Returns
true
on success,false
otherwise.See also
- setServerPushEnabled(enable)¶
- Parameters:
enable – bool
If
enable
istrue
, a remote server can potentially use server push to send responses in advance.See also
- setSessionReceiveWindowSize(size)¶
- Parameters:
size – int
- Return type:
bool
Sets the window size for connection-level flow control.
size
cannot be 0 and must not exceed 2147483647 octets.Returns
true
on success,false
otherwise.See also
- setStreamReceiveWindowSize(size)¶
- Parameters:
size – int
- Return type:
bool
Sets the window size for stream-level flow control.
size
cannot be 0 and must not exceed 2147483647 octets.Returns
true
on success,false
otherwise.See also
- streamReceiveWindowSize()¶
- Return type:
int
Returns the window size for stream-level flow control. The default value
QNetworkAccessManager
will be using is 214748364 octets (see RFC 7540 ).See also
- swap(other)¶
- Parameters:
other –
QHttp2Configuration
Swaps this configuration with the
other
configuration.