Http.Range
Range requests.
Support for range requests.
type bytes = [
| `First of int
First given offset to last offset
*)| `Last of int
At most last given n
bytes.
| `Range of int * int
First offset and last offset.
*) ]
The type for byte range specifications. Offsets are zero-based.
val eval_bytes : length:int -> bytes -> (int * int) option
eval_bytes ~length b
given a representation length len
and byte range b
returns a concrete zero-based byte range or None
if the range cannot be satisfied for length
.
type t = [
| `Bytes of bytes list
Byte ranges.
*)| `Other of string * string
Range unit and value.
*) ]
The type for ranges.
val encode : t -> string
encode r
serializes ranges r
in unit u
. It's the client duty to make sure ranges are valid.