RangeHeader class final

A class representing the HTTP Range header.

This class manages byte ranges, such as bytes=0-499 or multiple ranges like bytes=200-999, 2000-2499, 9500-. It allows clients to request specific parts of a resource. It provides functionality to parse and generate range header values for different range units like bytes or custom units.

Constructors

RangeHeader({String unit = 'bytes', required List<Range> ranges})
Constructs a RangeHeader instance with the specified unit and list of ranges.
RangeHeader.parse(String value)
Parses the Range header value and returns a RangeHeader instance.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
ranges → List<Range>
The list of ranges specified in the header.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unit → String
The unit of the range (e.g., "bytes").
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

codec → const HeaderCodec<RangeHeader>