PySide6.QtHttpServer.QHttpServerConfiguration¶
- class QHttpServerConfiguration¶
The
QHttpServerConfigurationclass controls server parameters.Added in version 6.9.
Synopsis¶
Methods¶
def
__init__()def
maximumUrlSize()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
- __init__()¶
Default constructs a
QHttpServerConfigurationobject.Such a configuration has the following values:
Rate limit is disabled.
Keep-alive timeout is set to 15 seconds.
Whitelist is empty.
Blacklist is empty.
Maximum Url size is 64 KiB.
Maximum total header size is 64 KiB.
Maximum header field size is 48 KiB.
Maximum number of header fields is 128.
Maximum body size is 32 MiB.
- __init__(other)
- Parameters:
other –
QHttpServerConfiguration
Copy-constructs this
QHttpServerConfiguration.- keepAliveTimeout()¶
- Return type:
std::chrono::seconds
Returns the keep-alive timeout used by
QHttpServer. This is the amount of time an idle connections may remain open before it is timed out.See also
- maximumBodySize()¶
- Return type:
int
Returns the maximum size of the incoming body accepted by the server.
See also
- maximumHeaderFieldCount()¶
- Return type:
int
Returns the maximum number of incoming header fields accepted by the server.
See also
- maximumHeaderFieldSize()¶
- Return type:
int
Returns the maximum size of each incoming header field accepted by the server.
See also
- maximumTotalHeaderSize()¶
- Return type:
int
Returns the maximum size of the total incoming headers accepted by the server.
See also
- maximumUrlSize()¶
- Return type:
int
Returns the maximum size of the URL accepted by the server.
See also
- __ne__(rhs)¶
- Parameters:
rhs –
QHttpServerConfiguration- Return type:
bool
- __eq__(rhs)¶
- Parameters:
rhs –
QHttpServerConfiguration- Return type:
bool
- rateLimitPerSecond()¶
- Return type:
int
Returns maximum number of incoming requests per second per IP accepted by the server.
This limit is applied separately to each client IP address. Returns 0 if rate limiting is disabled.
See also
- setKeepAliveTimeout(timeout)¶
- Parameters:
timeout –
std::chrono::seconds
Sets
timeoutas keep-alive timeout forQHttpServer.The keep-alive timeout determines how long an idle connection is kept open before being closed.
By default, the timeout is set to 15 seconds.
See also
- setMaximumBodySize(maxBodySize)¶
- Parameters:
maxBodySize – int
Sets
maxSizeas the maximum size of the request body that the server will accept. If the limit is exceeded,QHttpServerwill respond with status 413 Content Too Large. IfmaxSizeis -1 there is no limit.The default is 32 MiB.
See also
- setMaximumHeaderFieldCount(maxNumberOfHeaders)¶
- Parameters:
maxNumberOfHeaders – int
Sets
maxSizeas the maximum number of header fields that the server will accept in a request. If the limit is exceeded,QHttpServerwill respond with status 431 Request Header Fields Too Large. IfmaxSizeis -1 there is no limit.The default is 128.
See also
- setMaximumHeaderFieldSize(maxSingleHeaderSize)¶
- Parameters:
maxSingleHeaderSize – int
Sets
maxSizeas the maximum size of any single header field that the server will accept in a request. If the limit is exceeded,QHttpServerwill respond with status 431 Request Header Fields Too Large. IfmaxSizeis -1 there is no limit.The default is 48 KiB.
See also
- setMaximumTotalHeaderSize(maxTotalHeadersSize)¶
- Parameters:
maxTotalHeadersSize – int
Sets
maxSizeas the maximum total size of the header fields that the server will accept in a request. If the limit is exceeded,QHttpServerwill respond with status 431 Request Header Fields Too Large. IfmaxSizeis -1 there is no limit.The default is 64 KiB.
See also
- setMaximumUrlSize(maxUrlSize)¶
- Parameters:
maxUrlSize – int
Sets
maxSizeas the maximum size of the request URL that the server will accept. If the limit is exceeded,QHttpServerwill respond with status 414 Request-URI Too Long. IfmaxSizeis -1 there is no limit.The default is 64 KiB.
See also
- setRateLimitPerSecond(maxRequests)¶
- Parameters:
maxRequests – int
Sets
maxRequestsas the maximum number of incoming requests per second per IP that will be accepted byQHttpServer. If the limit is exceeded,QHttpServerwill respond withTooManyRequests.This limit is applied separately to each client IP address. A value of 0 disables rate limiting.
By default, rate limiting is disabled.
See also
- swap(other)¶
- Parameters:
other –
QHttpServerConfiguration
Swaps this configuration with
other. This operation is very fast and never fails.