PySide6.QtNetwork.QHttpHeaderRangeSet

class QHttpHeaderRangeSet

QHttpHeaderRangeSet represents the byte ranges of an HTTP Range header.

Details

QHttpHeaderRangeSet holds a sequence of QHttpHeaderRangeSpec objects, as they appear in such a header, which RFC 9110 calls a range-set.

The ranges are kept in the order in which they were given, because that is the order in which a server is asked to send them. The class does not interpret them: neither overlapping nor invalid ranges are rejected or merged.

Each range is a byte range, as defined in RFC 9110 Section 14.1.1 :

  • If the start is specified but the end is not (e.g., “bytes=500-“), the QHttpHeaderRangeSpec will have start=500 and end=std::nullopt.

  • If the end is specified but the start is not (e.g., “bytes=-500”), the QHttpHeaderRangeSpec will have start=std::nullopt and end=500, representing the last 500 bytes.

  • If both are specified (e.g., “bytes=0-499”), the QHttpHeaderRangeSpec will have start=0 and end=499.

See also

QHttpHeaderRangeSpec rangeValues() setRangeValues()

Synopsis

Methods

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__()

Constructs a QHttpHeaderRangeSet object with no ranges.

__init__(list)
Parameters:

list – PySequence

__init__(other)
Parameters:

other – QHttpHeaderRangeSet

Creates a copy of other.

__ne__(rhs)
Parameters:

rhs – QHttpHeaderRangeSet

Return type:

bool

__eq__(rhs)
Parameters:

rhs – QHttpHeaderRangeSet

Return type:

bool

ranges()
Return type:

PySequence

setRanges(list)
Parameters:

list – PySequence

swap(other)
Parameters:

other – QHttpHeaderRangeSet

Swaps this ranges object with other. This operation is very fast and never fails.