galileo_range_header

Last updated:

0 purchases

galileo_range_header Image
galileo_range_header Images
Add to Cart

Description:

galileo range header

range_header #


Range header parser for Dart.
Installation #
In your pubspec.yaml:
dependencies:
range_header: ^2.0.0
copied to clipboard
Usage #
handleRequest(HttpRequest request) async {
// Parse the header
var header = new RangeHeader.parse(request.headers.value(HttpHeaders.rangeHeader));

// Optimize/canonicalize it
var items = RangeHeader.foldItems(header.items);
header = new RangeHeader(items);

// Get info
header.items;
header.rangeUnit;
print(header.items[0].toContentRange(fileSize));

// Serve the file
var transformer = new RangeHeaderTransformer(header);
await file.openRead().transform(transformer).pipe(request.response);
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.